語言

Marshal.GetObjectsForNativeVariants 方法

定義

多載

名稱 Description
GetObjectsForNativeVariants(IntPtr, Int32)
已淘汰.

將一組 COM 變體 轉換為一組物件。

GetObjectsForNativeVariants<T>(IntPtr, Int32)
已淘汰.

將一組 COM 變體轉換為指定類型的陣列。

GetObjectsForNativeVariants(IntPtr, Int32)

來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs

警告

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

將一組 COM 變體 轉換為一組物件。

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 變體陣列的第一個元素的指標。

cVars
Int32

中 COM 變體 aSrcNativeVariant的數量。

傳回

Object[]

一個對應於 aSrcNativeVariant的物件陣列。

屬性

例外狀況

cVars 是一個負數。

備註

GetObjectsForNativeVariants 回傳一個受管理物件陣列,對應於一個原始指標,指向一個 C 風格的未受管理 VARIANT 類型陣列。 當將 VARIANT 類型暴露給受管理程式碼時,互操作管理器執行相同的轉換。 當 cVars 參數為 0 時,該方法會回傳一個空陣列。

物件陣列(回傳值)照常被垃圾回收。 未管理的輸入陣列或輸入陣列中的個別變體不會被釋放。 因此,適當地釋放他們是你的責任。

適用於

GetObjectsForNativeVariants<T>(IntPtr, Int32)

來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs
來源:
Marshal.NoCom.cs

警告

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

將一組 COM 變體轉換為指定類型的陣列。

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 變體陣列的第一個元素的指標。

cVars
Int32

中 COM 變體 aSrcNativeVariant的數量。

傳回

T[]

一個對應於 T的物件陣列aSrcNativeVariant。

屬性

例外狀況

cVars 是一個負數。

備註

GetObjectsForNativeVariants<T>(IntPtr, Int32) 回傳一個 T 陣列,對應於一個原始指標,指向一個 C 風格的未管理變體型態陣列。 當將 VARIANT 類型暴露給受管理程式碼時,互操作管理器執行相同的轉換。 當 cVars 參數為 0 時,該方法會回傳一個空陣列。

回傳的陣列照常被垃圾回收。 未管理的輸入陣列或輸入陣列中的個別變體不會被釋放。 因此,適當地釋放他們是你的責任。

適用於