ComWrappers.CreateObject 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| CreateObject(IntPtr, CreateObjectFlags) |
為 |
| CreateObject(IntPtr, CreateObjectFlags, Object, CreatedWrapperFlags) |
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回 。
適用於
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
- flags
- CreateObjectFlags
- userState
- Object
- wrapperFlags
- CreatedWrapperFlags