Marshal.GetNativeVariantForObject 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetNativeVariantForObject(Object, IntPtr) |
已淘汰.
將物件轉換為 COM VARIANT。 |
GetNativeVariantForObject<T>(T, IntPtr) |
已淘汰.
將所指定類型的物件轉換成 COM VARIANT。 |
GetNativeVariantForObject(Object, IntPtr)
警告
GetNativeVariantForObject(Object, IntPtr) may be unavailable in future releases.
將物件轉換為 COM VARIANT。
public:
static void GetNativeVariantForObject(System::Object ^ obj, IntPtr pDstNativeVariant);
[System.Obsolete("GetNativeVariantForObject(Object, IntPtr) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static void GetNativeVariantForObject (object? obj, IntPtr pDstNativeVariant);
[System.Obsolete("GetNativeVariantForObject(Object, IntPtr) may be unavailable in future releases.")]
public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant);
public static void GetNativeVariantForObject (object? obj, IntPtr pDstNativeVariant);
public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant);
[System.Security.SecurityCritical]
public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant);
[<System.Obsolete("GetNativeVariantForObject(Object, IntPtr) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetNativeVariantForObject : obj * nativeint -> unit
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetNativeVariantForObject : obj * nativeint -> unit
[<System.Obsolete("GetNativeVariantForObject(Object, IntPtr) may be unavailable in future releases.")>]
static member GetNativeVariantForObject : obj * nativeint -> unit
static member GetNativeVariantForObject : obj * nativeint -> unit
[<System.Security.SecurityCritical>]
static member GetNativeVariantForObject : obj * nativeint -> unit
Public Shared Sub GetNativeVariantForObject (obj As Object, pDstNativeVariant As IntPtr)
參數
- obj
- Object
要為其取得 COM VARIANT 的物件。
- pDstNativeVariant
-
IntPtr
nativeint
指標,用來接收對應於 obj
參數的 VARIANT。
- 屬性
例外狀況
obj
參數是泛型型別的執行個體。
備註
參數 pDstNativeVariant
必須指向足夠的記憶體,才能儲存產生的 VARIANT。 此外,此方法的實作會在參數指向的原始記憶體pDstNativeVariant
上呼叫 VariantInit 函式。
適用於
GetNativeVariantForObject<T>(T, IntPtr)
警告
GetNativeVariantForObject<T>(T, IntPtr) may be unavailable in future releases.
將所指定類型的物件轉換成 COM VARIANT。
public:
generic <typename T>
static void GetNativeVariantForObject(T obj, IntPtr pDstNativeVariant);
[System.Obsolete("GetNativeVariantForObject<T>(T, IntPtr) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static void GetNativeVariantForObject<T> (T? obj, IntPtr pDstNativeVariant);
[System.Obsolete("GetNativeVariantForObject<T>(T, IntPtr) may be unavailable in future releases.")]
public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant);
public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant);
[System.Security.SecurityCritical]
public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant);
[<System.Obsolete("GetNativeVariantForObject<T>(T, IntPtr) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetNativeVariantForObject : 'T * nativeint -> unit
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetNativeVariantForObject : 'T * nativeint -> unit
[<System.Obsolete("GetNativeVariantForObject<T>(T, IntPtr) may be unavailable in future releases.")>]
static member GetNativeVariantForObject : 'T * nativeint -> unit
static member GetNativeVariantForObject : 'T * nativeint -> unit
[<System.Security.SecurityCritical>]
static member GetNativeVariantForObject : 'T * nativeint -> unit
Public Shared Sub GetNativeVariantForObject(Of T) (obj As T, pDstNativeVariant As IntPtr)
類型參數
- T
要轉換的物件類型。
參數
- obj
- T
要為其取得 COM VARIANT 的物件。
- pDstNativeVariant
-
IntPtr
nativeint
指標,用來接收對應於 obj
參數的 VARIANT。
- 屬性
備註
參數 pDstNativeVariant
必須指向足夠的記憶體,才能儲存產生的 VARIANT。 此外,此方法的實作會在參數指向的原始記憶體pDstNativeVariant
上呼叫 VariantInit 函式。