DispatchWrapper Clase

Definición

Precaución

DispatchWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.

Encapsula los objetos cuyas referencias se van a calcular como VT_DISPATCH.Wraps objects the marshaler should marshal as a VT_DISPATCH.

public ref class DispatchWrapper sealed
public sealed class DispatchWrapper
[System.Obsolete("DispatchWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")]
public sealed class DispatchWrapper
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class DispatchWrapper
type DispatchWrapper = class
[<System.Obsolete("DispatchWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")>]
type DispatchWrapper = class
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type DispatchWrapper = class
Public NotInheritable Class DispatchWrapper
Herencia
DispatchWrapper
Atributos

Comentarios

Use para ajustar los objetos en los que el contador de referencias debe calcular referencias como VT_DISPATCH .Use to wrap objects the marshaler should marshal as a VT_DISPATCH. Este contenedor forzará el cálculo de referencias de objetos como VT_DISPATCH .This wrapper will force objects to be marshaled out as VT_DISPATCH. Si el objeto no admite IDispatch , se producirá una excepción.If the object does not support IDispatch then an exception will be thrown.

void MyMethod(Object^ o);

void DoWrap()
{
    Object^ o = gcnew MyObject();
    MyMethod(o);                        // passes o as VT_UNKNOWN
    MyMethod(gcnew DispatchWrapper(o)); // passes o as VT_DISPATCH

    //...
}
void MyMethod(Object o);

public void DoWrap()
{
    Object o = new MyObject();
    MyMethod(o);                      // passes o as VT_UNKNOWN
    MyMethod(new DispatchWrapper(o)); // passes o as VT_DISPATCH

    //...
}
Sub MyMethod(o As Object)
    ' handle object ...
End Sub

Public Sub DoWrap()
    Dim o As Object = new MyObject()
    MyMethod(o)                      ' passes o as VT_UNKNOWN
    MyMethod(new DispatchWrapper(o)) ' passes o as VT_DISPATCH

    '...
End Sub

Para obtener más información sobre VT_DISPATCH , vea la documentación existente para VARENUM::VT_DISPATCH en MSDN Library.For more information on VT_DISPATCH, please see the existing documentation for VARENUM::VT_DISPATCH in the MSDN library.

Constructores

DispatchWrapper(Object)

Inicializa una nueva instancia de la clase DispatchWrapper con el objeto que se va a ajustar.Initializes a new instance of the DispatchWrapper class with the object being wrapped.

Propiedades

WrappedObject

Obtiene el objeto ajustado por DispatchWrapper.Gets the object wrapped by the DispatchWrapper.

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.Determines whether the specified object is equal to the current object.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.Creates a shallow copy of the current Object.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Heredado de Object)

Se aplica a