Marshal.GetObjectsForNativeVariants 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetObjectsForNativeVariants(IntPtr, Int32) |
已淘汰.
將 COM VARIANT 的陣列轉換成物件陣列。 |
GetObjectsForNativeVariants<T>(IntPtr, Int32) |
已淘汰.
將 COM VARIANT 的陣列轉換為所指定類型的陣列。 |
GetObjectsForNativeVariants(IntPtr, Int32)
警告
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 的計數。
傳回
對應於 aSrcNativeVariant
的物件陣列。
- 屬性
例外狀況
cVars
為負數。
備註
GetObjectsForNativeVariants 會傳回 Managed 物件的數位,該數位對應至 Unmanaged VARIANT 類型的 C 樣式陣列的原始指標。 Interopmarshaler 會在將 VARIANT 類型公開給 Managed 程式代碼時執行相同的轉換。 當 參數為 0 時, cVars
方法會傳回空陣列。
對象陣列 (傳回值,) 如往常一樣收集垃圾。 不會釋放輸入陣列中的 Unmanaged 輸入陣列或個別 VWT。 因此,您必須負責適當地釋出它們。
適用於
GetObjectsForNativeVariants<T>(IntPtr, Int32)
警告
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
的 aSrcNativeVariant
物件陣列。
- 屬性
例外狀況
cVars
為負數。
備註
GetObjectsForNativeVariants<T>(IntPtr, Int32) 會傳回 的 T
陣列,對應至非受控 VARIANT 型別 C 樣式陣列的原始指標。 Interopmarshaler 會在將 VARIANT 類型公開給 Managed 程式代碼時執行相同的轉換。 當 參數為 0 時, cVars
方法會傳回空陣列。
傳回的陣列會如往常一樣進行垃圾收集。 不會釋放輸入陣列中的 Unmanaged 輸入陣列或個別 VWT。 因此,您必須負責適當地釋出它們。