共用方式為


ComWrappers.CreateObject 方法

定義

多載

CreateObject(IntPtr, CreateObjectFlags)

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

CreateObject(IntPtr, CreateObjectFlags, Object, CreatedWrapperFlags)

CreateObject(IntPtr, CreateObjectFlags)

來源:
ComWrappers.cs
來源:
ComWrappers.cs
來源:
ComWrappers.cs
來源:
ComWrappers.cs

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回 。

適用於

CreateObject(IntPtr, CreateObjectFlags, Object, CreatedWrapperFlags)

protected:
 virtual System::Object ^ CreateObject(IntPtr externalComObject, System::Runtime::InteropServices::CreateObjectFlags flags, System::Object ^ userState, [Runtime::InteropServices::Out] System::Runtime::InteropServices::CreatedWrapperFlags % wrapperFlags);
protected virtual object? CreateObject(IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags, object? userState, out System.Runtime.InteropServices.CreatedWrapperFlags wrapperFlags);
abstract member CreateObject : nativeint * System.Runtime.InteropServices.CreateObjectFlags * obj * CreatedWrapperFlags -> obj
override this.CreateObject : nativeint * System.Runtime.InteropServices.CreateObjectFlags * obj * CreatedWrapperFlags -> obj
Protected Overridable Function CreateObject (externalComObject As IntPtr, flags As CreateObjectFlags, userState As Object, ByRef wrapperFlags As CreatedWrapperFlags) As Object

參數

externalComObject
IntPtr

nativeint

userState
Object
wrapperFlags
CreatedWrapperFlags

傳回

適用於