Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


ComWrappers.GetOrCreateComInterfaceForObject 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.

Creates a COM representation of the supplied object that can be passed to a non-managed environment.

C#
public IntPtr GetOrCreateComInterfaceForObject(object instance, System.Runtime.InteropServices.CreateComInterfaceFlags flags);

Parameters

instance
Object

The managed object to expose outside the .NET runtime.

flags
CreateComInterfaceFlags

Flags used to configure the generated interface.

Returns

IntPtr

The generated COM interface, as a pointer to the IUnknown interface implementation, that can be passed outside the .NET runtime.

Remarks

If a COM representation was previously created for the specified instance using this ComWrappers instance, the previously created COM interface will be returned. If not, a new one will be created.

Applies to

Termék Verziók
.NET 5, 6, 7, 8, 9, 10