Rediger

Del via


Marshal.GetObjectsForNativeVariants Method

Definition

Overloads

GetObjectsForNativeVariants(IntPtr, Int32)
Obsolete.

Converts an array of COM VARIANTs to an array of objects.

GetObjectsForNativeVariants<T>(IntPtr, Int32)
Obsolete.

Converts an array of COM VARIANTs to an array of a specified type.

GetObjectsForNativeVariants(IntPtr, Int32)

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

Caution

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

Converts an array of COM VARIANTs to an array of objects.

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()

Parameters

aSrcNativeVariant
IntPtr

nativeint

A pointer to the first element of an array of COM VARIANTs.

cVars
Int32

The count of COM VARIANTs in aSrcNativeVariant.

Returns

Object[]

An object array that corresponds to aSrcNativeVariant.

Attributes

Exceptions

cVars is a negative number.

Remarks

GetObjectsForNativeVariants returns an array of managed objects that corresponds to a raw pointer to a C-style array of unmanaged VARIANT types. The interopmarshaler performs the identical transformation when exposing a VARIANT type to managed code. The method returns an empty array when the cVars parameter is 0.

The object array (the return value) gets garbage collected as usual. The unmanaged input array or individual VARIANTs in the input array are not freed. Therefore it is your responsibility to free them as appropriate.

Applies to

GetObjectsForNativeVariants<T>(IntPtr, Int32)

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

Caution

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

Converts an array of COM VARIANTs to an array of a specified type.

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()

Type Parameters

T

The type of the array to return.

Parameters

aSrcNativeVariant
IntPtr

nativeint

A pointer to the first element of an array of COM VARIANTs.

cVars
Int32

The count of COM VARIANTs in aSrcNativeVariant.

Returns

T[]

An array of T objects that corresponds to aSrcNativeVariant.

Attributes

Exceptions

cVars is a negative number.

Remarks

GetObjectsForNativeVariants<T>(IntPtr, Int32) returns an array of T that corresponds to a raw pointer to a C-style array of unmanaged VARIANT types. The interopmarshaler performs the identical transformation when exposing a VARIANT type to managed code. The method returns an empty array when the cVars parameter is 0.

The returned array is garbage-collected as usual. The unmanaged input array or individual VARIANTs in the input array are not freed. Therefore, it is your responsibility to free them as appropriate.

Applies to