System.Runtime.InteropServices.Marshal.GetObjectsForNativeVariants Method

Converts an array of COM tp://go.microsoft.com/fwlink/?LinkId=148670 to an array of objects.

Syntax

public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars)

Parameters

aSrcNativeVariant
A pointer to the first element of an array of COM VARIANTs.
cVars
The count of COM VARIANTs in aSrcNativeVariant.

Returns

An object array that corresponds to aSrcNativeVariant.

Remarks

Marshal.GetObjectsForNativeVariants(IntPtr, int) returns an array of managed objects that corresponds to a raw pointer to a C-style array of unmanaged VARIANT types. The interop marshaler 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.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0