Marshal.GetNativeVariantForObject<'T> Method ('T, IntPtr)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

[Supported in the .NET Framework 4.5.1 and later versions]

Converts an object of a specified type to a COM VARIANT.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

[<SecurityCriticalAttribute>]
static member GetNativeVariantForObject<'T> : 
        obj:'T *
        pDstNativeVariant:nativeint -> unit

Parameters

obj
Type: T

The object for which to get a COM VARIANT.

pDstNativeVariant
Type: System.IntPtr

A pointer to receive the VARIANT that corresponds to the obj parameter.

Type Parameters

T

The type of the object to convert.

The pDstNativeVariant parameter must point to sufficient memory to store the resulting VARIANT. Also, the implementation of this method calls VariantInit function on the raw memory that the pDstNativeVariant parameter points to.

SecurityCriticalAttribute

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Universal Windows Platform
Available since 8.1
.NET Framework
Available since 4.5.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: