ComWrappers.RegisterForMarshalling(ComWrappers) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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