Marshal.GetNativeVariantForObject(Of T) Method (T, IntPtr)

 

[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>
Public Shared Sub GetNativeVariantForObject(Of T) (
	obj As T,
	pDstNativeVariant As IntPtr
)

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: