Marshal.GetNativeVariantForObject 方法

定义

重载

GetNativeVariantForObject(Object, IntPtr)
已过时.

将对象转换为 COM VARIANT。

GetNativeVariantForObject<T>(T, IntPtr)
已过时.

将指定类型的对象转换为 COM VARIANT。

GetNativeVariantForObject(Object, IntPtr)

Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs

注意

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)

Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs

注意

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 函数。

适用于