Compartilhar via


Método Marshal.GetIDispatchForObjectInContext (Object)

 

Dica

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

Retornará um ponteiro de interface IDispatch de um objeto gerenciado se o chamador estiver no mesmo contexto que o objeto.

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

Sintaxe

[SecurityCriticalAttribute]
public static IntPtr GetIDispatchForObjectInContext(
    object o
)
public:
[SecurityCriticalAttribute]
static IntPtr GetIDispatchForObjectInContext(
    Object^ o
)
[<SecurityCriticalAttribute>]
static member GetIDispatchForObjectInContext : 
        o:Object -> nativeint
<SecurityCriticalAttribute>
Public Shared Function GetIDispatchForObjectInContext (
    o As Object
) As IntPtr

Parâmetros

  • o
    Type: System.Object

    O objeto cuja interface IDispatch é solicitada.

Valor Retornado

Type: System.IntPtr

O ponteiro de interface IDispatch para o objeto especificado ou null, se o chamador não estiver no mesmo contexto que o objeto especificado.

Exceções

Exception Condition
InvalidCastException

o não dá suporte à interface solicitada.

ArgumentNullException

o é null.

Comentários

Esse método é o mesmo que GetIDispatchForObject exceto que ela retorna null se o chamador não está no mesmo contexto de objeto.

Segurança

SecurityCriticalAttribute

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

Informações de Versão

.NET Framework
Disponível desde 2.0

Confira Também

Release
GetIDispatchForObject
Classe Marshal
Namespace System.Runtime.InteropServices

Retornar ao início