Edit

Share via


ComWrappers.GetOrCreateObjectForComInstance Method

Definition

Overloads

GetOrCreateObjectForComInstance(IntPtr, CreateObjectFlags)

Gets the currently registered managed object or creates a new managed object and registers it.

GetOrCreateObjectForComInstance(IntPtr, CreateObjectFlags, Object)

Gets the currently registered managed object or creates a new managed object and registers it.

GetOrCreateObjectForComInstance(IntPtr, CreateObjectFlags)

Source:
ComWrappers.cs
Source:
ComWrappers.cs
Source:
ComWrappers.cs
Source:
ComWrappers.cs

Gets the currently registered managed object or creates a new managed object and registers it.

public:
 System::Object ^ GetOrCreateObjectForComInstance(IntPtr externalComObject, System::Runtime::InteropServices::CreateObjectFlags flags);
public object GetOrCreateObjectForComInstance(IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags);
member this.GetOrCreateObjectForComInstance : nativeint * System.Runtime.InteropServices.CreateObjectFlags -> obj
Public Function GetOrCreateObjectForComInstance (externalComObject As IntPtr, flags As CreateObjectFlags) As Object

Parameters

externalComObject
IntPtr

nativeint

Object to import for usage into the .NET runtime.

flags
CreateObjectFlags

Flags used to describe the external object.

Returns

A managed object associated with the supplied external COM object.

Remarks

If a managed object was previously created for the specified externalComObject using this ComWrappers instance, the previously created object will be returned. If not, a new one will be created.

Applies to

GetOrCreateObjectForComInstance(IntPtr, CreateObjectFlags, Object)

Gets the currently registered managed object or creates a new managed object and registers it.

public:
 System::Object ^ GetOrCreateObjectForComInstance(IntPtr externalComObject, System::Runtime::InteropServices::CreateObjectFlags flags, System::Object ^ userState);
public object GetOrCreateObjectForComInstance(IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags, object? userState);
member this.GetOrCreateObjectForComInstance : nativeint * System.Runtime.InteropServices.CreateObjectFlags * obj -> obj
Public Function GetOrCreateObjectForComInstance (externalComObject As IntPtr, flags As CreateObjectFlags, userState As Object) As Object

Parameters

externalComObject
IntPtr

nativeint

The object to import for usage into the .NET runtime.

flags
CreateObjectFlags

A bitwise combination of the enumeration values that describes the external object.

userState
Object

A state object to use to help create the wrapping .NET object.

Returns

Returns a managed object associated with the supplied external COM object.

Remarks

If a managed object was previously created for the specified externalComObject using this ComWrappers instance, the previously created object is returned. If not, a new one is created.

Applies to