DispatchWrapper Classe
Definizione
Attenzione
DispatchWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.
Esegue il wrapping degli oggetti di cui il gestore di marshalling deve eseguire il marshalling come VT_DISPATCH
.Wraps objects the marshaler should marshal as a 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
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
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
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
type DispatchWrapper = class
type DispatchWrapper = class
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type DispatchWrapper = class
Public NotInheritable Class DispatchWrapper
- Ereditarietà
-
DispatchWrapper
- Attributi
Commenti
Utilizzare per eseguire il wrapping degli oggetti di cui il gestore di marshalling deve VT_DISPATCH
effettuare il marshallingUse to wrap objects the marshaler should marshal as a VT_DISPATCH
. Questo wrapper forza l'esecuzione del marshalling degli oggetti come VT_DISPATCH
.This wrapper will force objects to be marshaled out as VT_DISPATCH
. Se l'oggetto non supporta IDispatch
, verrà generata un'eccezione.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
Per ulteriori informazioni su VT_DISPATCH
, consultare la documentazione esistente per VARENUM::VT_DISPATCH
in MSDN Library.For more information on VT_DISPATCH
, please see the existing documentation for VARENUM::VT_DISPATCH
in the MSDN library.
Costruttori
DispatchWrapper(Object) |
Inizializza una nuova istanza della classe DispatchWrapper con l'oggetto di cui è stato eseguito il wrapping.Initializes a new instance of the DispatchWrapper class with the object being wrapped. |
Proprietà
WrappedObject |
Ottiene l'oggetto di cui è stato eseguito il wrapping da DispatchWrapper.Gets the object wrapped by the DispatchWrapper. |
Metodi
Equals(Object) |
Determina se l'oggetto specificato è uguale all'oggetto corrente.Determines whether the specified object is equal to the current object. (Ereditato da Object) |
GetHashCode() |
Funge da funzione hash predefinita.Serves as the default hash function. (Ereditato da Object) |
GetType() |
Ottiene l'oggetto Type dell'istanza corrente.Gets the Type of the current instance. (Ereditato da Object) |
MemberwiseClone() |
Crea una copia superficiale dell'oggetto Object corrente.Creates a shallow copy of the current Object. (Ereditato da Object) |
ToString() |
Restituisce una stringa che rappresenta l'oggetto corrente.Returns a string that represents the current object. (Ereditato da Object) |