Share via


ComWrappers.CreateObject(IntPtr, CreateObjectFlags) 方法

定義

externalComObject 指向的物件,建立受管理的物件,並參考 flags 的值。

protected:
 abstract System::Object ^ CreateObject(IntPtr externalComObject, System::Runtime::InteropServices::CreateObjectFlags flags);
protected abstract object? CreateObject (IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags);
abstract member CreateObject : nativeint * System.Runtime.InteropServices.CreateObjectFlags -> obj
Protected MustOverride Function CreateObject (externalComObject As IntPtr, flags As CreateObjectFlags) As Object

參數

externalComObject
IntPtr

nativeint

要匯入供 .NET 執行階段使用的物件。

flags
CreateObjectFlags

用以描述外部物件的旗標。

傳回

所提供外部 COM 物件相關聯之受管理的物件。

備註

如果無法建立物件並 null 傳回 ,呼叫 GetOrCreateObjectForComInstance(IntPtr, CreateObjectFlags) 將會擲 ArgumentNullException 回 。

適用於