Marshal.GetObjectForNativeVariant Método

Definição

Sobrecargas

GetObjectForNativeVariant(IntPtr)
Obsoleto.

Converte um COM VARIANT em um objeto.Converts a COM VARIANT to an object.

GetObjectForNativeVariant<T>(IntPtr)
Obsoleto.

[Suporte somente no .NET Framework 4.5.1 e versões posteriores][Supported in the .NET Framework 4.5.1 and later versions]

Converte uma VARIANTE do COM em um objeto de um tipo especificado.Converts a COM VARIANT to an object of a specified type.

GetObjectForNativeVariant(IntPtr)

Cuidado

GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.

Converte um COM VARIANT em um objeto.Converts a COM VARIANT to an object.

public:
 static System::Object ^ GetObjectForNativeVariant(IntPtr pSrcNativeVariant);
[System.Obsolete("GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static object? GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
[System.Obsolete("GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.")]
public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
public static object? GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
[System.Security.SecurityCritical]
public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant);
[<System.Obsolete("GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetObjectForNativeVariant : nativeint -> obj
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetObjectForNativeVariant : nativeint -> obj
static member GetObjectForNativeVariant : nativeint -> obj
[<System.Obsolete("GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.")>]
static member GetObjectForNativeVariant : nativeint -> obj
[<System.Security.SecurityCritical>]
static member GetObjectForNativeVariant : nativeint -> obj
Public Shared Function GetObjectForNativeVariant (pSrcNativeVariant As IntPtr) As Object

Parâmetros

pSrcNativeVariant
IntPtr

Um ponteiro para um COM VARIANT.A pointer to a COM VARIANT.

Retornos

Object

Um objeto que corresponde ao parâmetro pSrcNativeVariant.An object that corresponds to the pSrcNativeVariant parameter.

Atributos

Exceções

pSrcNativeVariant não é um tipo VARIANT válido.pSrcNativeVariant is not a valid VARIANT type.

pSrcNativeVariant tem um tipo sem suporte.pSrcNativeVariant has an unsupported type.

Comentários

GetObjectForNativeVariant Retorna um objeto gerenciado que corresponde a um ponteiro bruto para um tipo de variante não gerenciado.GetObjectForNativeVariant returns a managed object that corresponds to a raw pointer to an unmanaged VARIANT type. O interopmarshaler executa a transformação idêntica ao expor um tipo de variante para código gerenciado.The interopmarshaler performs the identical transformation when exposing a VARIANT type to managed code.

GetObjectForNativeVariant fornece a funcionalidade oposta do Marshal.GetNativeVariantForObject .GetObjectForNativeVariant provides the opposite functionality of Marshal.GetNativeVariantForObject.

Quando o tipo de variante é VT_ERROR, GetObjectForNativeVariant retorna um objeto do tipo Int32 em vez de UInt32 .When the VARIANT type is VT_ERROR, GetObjectForNativeVariant returns an object of type Int32 instead of UInt32.

Confira também

Aplica-se a

GetObjectForNativeVariant<T>(IntPtr)

Cuidado

GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.

[Suporte somente no .NET Framework 4.5.1 e versões posteriores][Supported in the .NET Framework 4.5.1 and later versions]

Converte uma VARIANTE do COM em um objeto de um tipo especificado.Converts a COM VARIANT to an object of a specified type.

public:
generic <typename T>
 static T GetObjectForNativeVariant(IntPtr pSrcNativeVariant);
[System.Obsolete("GetObjectForNativeVariant<T>(IntPtr) may be unavailable in future releases.")]
[System.Security.SecurityCritical]
public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static T? GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant);
[System.Obsolete("GetObjectForNativeVariant<T>(IntPtr) may be unavailable in future releases.")]
public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant);
public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant);
[System.Security.SecurityCritical]
public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant);
[<System.Obsolete("GetObjectForNativeVariant<T>(IntPtr) may be unavailable in future releases.")>]
[<System.Security.SecurityCritical>]
static member GetObjectForNativeVariant : nativeint -> 'T
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetObjectForNativeVariant : nativeint -> 'T
static member GetObjectForNativeVariant : nativeint -> 'T
[<System.Obsolete("GetObjectForNativeVariant<T>(IntPtr) may be unavailable in future releases.")>]
static member GetObjectForNativeVariant : nativeint -> 'T
[<System.Security.SecurityCritical>]
static member GetObjectForNativeVariant : nativeint -> 'T
Public Shared Function GetObjectForNativeVariant(Of T) (pSrcNativeVariant As IntPtr) As T

Parâmetros de tipo

T

O tipo para o qual converter a variante COM.The type to which to convert the COM VARIANT.

Parâmetros

pSrcNativeVariant
IntPtr

Um ponteiro para um COM VARIANT.A pointer to a COM VARIANT.

Retornos

T

Um objeto do tipo especificado que corresponde ao parâmetro pSrcNativeVariant.An object of the specified type that corresponds to the pSrcNativeVariant parameter.

Atributos

Exceções

pSrcNativeVariant não é um tipo VARIANT válido.pSrcNativeVariant is not a valid VARIANT type.

pSrcNativeVariant tem um tipo sem suporte.pSrcNativeVariant has an unsupported type.

Comentários

GetObjectForNativeVariant<T>(IntPtr) Retorna um objeto gerenciado do tipo T que corresponde a um ponteiro bruto para um tipo de variante não gerenciado.GetObjectForNativeVariant<T>(IntPtr) returns a managed object of type T that corresponds to a raw pointer to an unmanaged VARIANT type. O interopmarshaler executa a transformação idêntica ao expor um tipo de variante para código gerenciado.The interopmarshaler performs the identical transformation when exposing a VARIANT type to managed code.

GetObjectForNativeVariant<T>(IntPtr) fornece a funcionalidade oposta do GetNativeVariantForObject<T>(T, IntPtr) .GetObjectForNativeVariant<T>(IntPtr) provides the opposite functionality of GetNativeVariantForObject<T>(T, IntPtr).

Aplica-se a