Uredi

Deli z drugimi prek


ComWrappers.RegisterForMarshalling(ComWrappers) Method

Definition

Registers a ComWrappers instance to be used as the global instance for marshalling in the runtime.

public:
 static void RegisterForMarshalling(System::Runtime::InteropServices::ComWrappers ^ instance);
public static void RegisterForMarshalling (System.Runtime.InteropServices.ComWrappers instance);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static void RegisterForMarshalling (System.Runtime.InteropServices.ComWrappers instance);
static member RegisterForMarshalling : System.Runtime.InteropServices.ComWrappers -> unit
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member RegisterForMarshalling : System.Runtime.InteropServices.ComWrappers -> unit
Public Shared Sub RegisterForMarshalling (instance As ComWrappers)

Parameters

instance
ComWrappers

The instance to register.

Attributes

Exceptions

The method was called more than once.

Remarks

This function can only be called a single time. Subsequent calls to this function will result in a InvalidOperationException being thrown. Scenarios where this global instance may be used are: * Usage of COM-related Marshal APIs * P/Invokes with COM-related types * COM activation

Applies to