DispatchWrapper DispatchWrapper DispatchWrapper DispatchWrapper Class

Definición

Advertencia

Esta API está ya obsoleta.

Ajusta los objetos que el contador de referencias debe calcular referencias como un VT_DISPATCH.Wraps objects the marshaler should marshal as a VT_DISPATCH.

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

Comentarios

Usar para ajustar objetos que el contador de referencias debe calcular referencias como un VT_DISPATCH.Use to wrap objects the marshaler should marshal as a VT_DISPATCH. Este contenedor obligará a calcularse como objetos VT_DISPATCH.This wrapper will force objects to be marshaled out as VT_DISPATCH. Si no es compatible con el objeto IDispatch , a continuación, 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, consulte 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) DispatchWrapper(Object) DispatchWrapper(Object) DispatchWrapper(Object)

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

Propiedades

WrappedObject WrappedObject WrappedObject WrappedObject

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

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

Se aplica a