Marshal.GetObjectsForNativeVariants 方法

定义

重载

GetObjectsForNativeVariants(IntPtr, Int32)
已过时.

将 COM VARIANT 数组转换为对象数组。

GetObjectsForNativeVariants<T>(IntPtr, Int32)
已过时.

将 COM VARIANT 数组转换为指定类型的数组。

GetObjectsForNativeVariants(IntPtr, Int32)

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

注意

GetObjectsForNativeVariants(IntPtr, Int32) may be unavailable in future releases.

将 COM VARIANT 数组转换为对象数组。

public:
 static cli::array <System::Object ^> ^ GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars);
[System.Obsolete("GetObjectsForNativeVariants(IntPtr, Int32) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static object?[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
[System.Obsolete("GetObjectsForNativeVariants(IntPtr, Int32) may be unavailable in future releases.")]
public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
public static object?[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
[System.Security.SecurityCritical]
public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars);
[<System.Obsolete("GetObjectsForNativeVariants(IntPtr, Int32) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetObjectsForNativeVariants : nativeint * int -> obj[]
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetObjectsForNativeVariants : nativeint * int -> obj[]
[<System.Obsolete("GetObjectsForNativeVariants(IntPtr, Int32) may be unavailable in future releases.")>]
static member GetObjectsForNativeVariants : nativeint * int -> obj[]
static member GetObjectsForNativeVariants : nativeint * int -> obj[]
[<System.Security.SecurityCritical>]
static member GetObjectsForNativeVariants : nativeint * int -> obj[]
Public Shared Function GetObjectsForNativeVariants (aSrcNativeVariant As IntPtr, cVars As Integer) As Object()

参数

aSrcNativeVariant
IntPtr

nativeint

指向 COM VARIANT 数组中第一个元素的指针。

cVars
Int32

aSrcNativeVariant 中的 COM VARIANT 的计数。

返回

Object[]

对应于 aSrcNativeVariant 的对象数组。

属性

例外

cVars 为负数。

注解

GetObjectsForNativeVariants 返回托管对象的数组,该数组对应于指向非托管 VARIANT 类型的 C 样式数组的原始指针。 向托管代码公开 VARIANT 类型时,互操作shaler 执行相同的转换。 当 参数为 0 时, cVars 方法返回一个空数组。

对象数组 (返回值,) 像往常一样收集垃圾。 不会释放非托管输入数组或输入数组中的单个 VARIANT。 因此,你有责任根据需要释放它们。

适用于

GetObjectsForNativeVariants<T>(IntPtr, Int32)

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

注意

GetObjectsForNativeVariants<T>(IntPtr, Int32) may be unavailable in future releases.

将 COM VARIANT 数组转换为指定类型的数组。

public:
generic <typename T>
 static cli::array <T> ^ GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars);
[System.Obsolete("GetObjectsForNativeVariants<T>(IntPtr, Int32) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars);
[System.Obsolete("GetObjectsForNativeVariants<T>(IntPtr, Int32) may be unavailable in future releases.")]
public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars);
public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars);
[System.Security.SecurityCritical]
public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars);
[<System.Obsolete("GetObjectsForNativeVariants<T>(IntPtr, Int32) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetObjectsForNativeVariants : nativeint * int -> 'T[]
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetObjectsForNativeVariants : nativeint * int -> 'T[]
[<System.Obsolete("GetObjectsForNativeVariants<T>(IntPtr, Int32) may be unavailable in future releases.")>]
static member GetObjectsForNativeVariants : nativeint * int -> 'T[]
static member GetObjectsForNativeVariants : nativeint * int -> 'T[]
[<System.Security.SecurityCritical>]
static member GetObjectsForNativeVariants : nativeint * int -> 'T[]
Public Shared Function GetObjectsForNativeVariants(Of T) (aSrcNativeVariant As IntPtr, cVars As Integer) As T()

类型参数

T

要返回的数组的类型。

参数

aSrcNativeVariant
IntPtr

nativeint

指向 COM VARIANT 数组中第一个元素的指针。

cVars
Int32

aSrcNativeVariant 中的 COM VARIANT 的计数。

返回

T[]

对应于 aSrcNativeVariantT 对象的数组。

属性

例外

cVars 为负数。

注解

GetObjectsForNativeVariants<T>(IntPtr, Int32) 返回 的 T 数组,该数组对应于指向非托管 VARIANT 类型的 C 样式数组的原始指针。 向托管代码公开 VARIANT 类型时,互操作shaler 执行相同的转换。 当 参数为 0 时, cVars 方法返回一个空数组。

返回的数组像往常一样进行垃圾回收。 不会释放非托管输入数组或输入数组中的单个 VARIANT。 因此,你有责任根据需要释放它们。

适用于