ComWrappers.GetOrCreateComInterfaceForObject Metodo

Definizione

Crea una rappresentazione COM dell'oggetto specificato che può essere passata a un ambiente non gestito.

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

Parametri

instance
Object

Oggetto gestito da esporre al di fuori del runtime .NET.

flags
CreateComInterfaceFlags

Flag usati per configurare l'interfaccia generata.

Restituisce

IntPtr

nativeint

Interfaccia COM generata, come puntatore all'implementazione dell'interfaccia, che può essere passata all'esterno IUnknown del runtime .NET.

Commenti

Se una rappresentazione COM è stata creata in precedenza per l'oggetto specificato instance utilizzando questa ComWrappers istanza, verrà restituita l'interfaccia COM creata in precedenza. In caso contrario, ne verrà creato uno nuovo.

Si applica a