Marshal::GetNativeVariantForObject<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.
Assembly: mscorlib (in mscorlib.dll)
public: generic<typename T> [SecurityCriticalAttribute] static void GetNativeVariantForObject( T obj, IntPtr pDstNativeVariant )
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.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
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