DispatchWrapper Classe

Definizione

Attenzione

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

Esegue il wrapping degli oggetti che il gestore di marshalling deve effettuare il marshalling come .VT_DISPATCH

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

Commenti

Usare per eseguire il wrapping degli oggetti che il gestore di marshalling deve effettuare il marshalling come .VT_DISPATCH Questo wrapper forza il marshalling degli oggetti come VT_DISPATCH. Se l'oggetto non supporta IDispatch , verrà generata un'eccezione.

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

Per altre informazioni su VT_DISPATCH, vedere la documentazione esistente per VARENUM::VT_DISPATCH in MSDN Library.

Costruttori

Nome Descrizione
DispatchWrapper(Object)
Obsoleti.

Inizializza una nuova istanza della DispatchWrapper classe con l'oggetto di cui viene eseguito il wrapping.

Proprietà

Nome Descrizione
WrappedObject
Obsoleti.

Ottiene l'oggetto di cui è stato eseguito il DispatchWrapperwrapping da .

Metodi

Nome Descrizione
Equals(Object)
Obsoleti.

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()
Obsoleti.

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()
Obsoleti.

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()
Obsoleti.

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()
Obsoleti.

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a