Skip to content

Commit 1370afa

Browse files
Update xml/System.Runtime.InteropServices/ICustomMarshaler.xml
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
1 parent 137accf commit 1370afa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System.Runtime.InteropServices/ICustomMarshaler.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const IID IID_IOld = {0x9B2BAADD,0x0705,0x11D3,{0xA0,0xCD,0x00,0xC0,0x4F,0xA3,0x
124124
Returns the size of the unmanaged data to be marshaled.
125125
126126
## Implementing the GetInstance Method
127-
In addition to implementing the <xref:System.Runtime.InteropServices.ICustomMarshaler> interface, custom marshalers must implement a `static` method called `GetInstance` that accepts a <xref:System.String> as a parameter and has a return type of <xref:System.Runtime.InteropServices.ICustomMarshaler>. This `static` method is called by the common language runtime's COM interop layer to instantiate an instance of the custom marshaler. The string that is passed to `GetInstance` is a cookie that the method can use to customize the returned custom marshaler. A minimal, but complete, <xref:System.Runtime.InteropServices.ICustomMarshaler> implementation in the form of the `NewOldMarshaler` type is below.
127+
In addition to implementing the <xref:System.Runtime.InteropServices.ICustomMarshaler> interface, custom marshalers must implement a `static` method called `GetInstance` that accepts a <xref:System.String> as a parameter and has a return type of <xref:System.Runtime.InteropServices.ICustomMarshaler>. This `static` method is called by the common language runtime's COM interop layer to instantiate an instance of the custom marshaler. The string that is passed to `GetInstance` is a cookie that the method can use to customize the returned custom marshaler. The following example shows a minimal, but complete, <xref:System.Runtime.InteropServices.ICustomMarshaler> implementation.
128128
129129
[!code-csharp[System.Runtime.InteropServices.ICustomMarshaler#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.runtime.interopservices.icustommarshaler/cs/source.cs#6)]
130130

0 commit comments

Comments
 (0)