Marshal::GetObjectForNativeVariant Method (IntPtr)
Converts a COM VARIANT to an object.
Assembly: mscorlib (in mscorlib.dll)
public: [SecurityCriticalAttribute] static Object^ GetObjectForNativeVariant( IntPtr pSrcNativeVariant )
Parameters
- pSrcNativeVariant
-
Type:
System::IntPtr
A pointer to a COM VARIANT.
| Exception | Condition |
|---|---|
| InvalidOleVariantTypeException | pSrcNativeVariant is not a valid VARIANT type. |
| NotSupportedException | pSrcNativeVariant has an unsupported type. |
GetObjectForNativeVariant returns a managed object that corresponds to a raw pointer to an unmanaged VARIANT type. The interopmarshaler performs the identical transformation when exposing a VARIANT type to managed code.
GetObjectForNativeVariant provides the opposite functionality of Marshal::GetNativeVariantForObject.
When the VARIANT type is VT_ERROR, GetObjectForNativeVariant returns an object of type Int32 instead of UInt32.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1