ComWrappers.GetOrCreateComInterfaceForObject Metodo

Definizione

Crea una rappresentazione COM dell'oggetto fornito che può essere passato 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 all'esterno del runtime di .NET.

flags
CreateComInterfaceFlags

Flag usati per configurare l'interfaccia generata.

Valori restituiti

IntPtr

nativeint

Interfaccia COM generata, come puntatore all'implementazione dell'interfaccia IUnknown, che può essere passata all'esterno 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