DispatchWrapper Kelas

Definisi

Perhatian

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

Membungkus objek marshaler harus marshal sebagai 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
Warisan
DispatchWrapper
Atribut

Keterangan

Gunakan untuk membungkus objek marshaler harus marshal sebagai VT_DISPATCH. Pembungkus ini akan memaksa objek untuk dinamai sebagai VT_DISPATCH. Jika objek tidak mendukung IDispatch maka pengecualian akan dilemparkan.

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

Untuk informasi selengkapnya tentang VT_DISPATCH, silakan lihat dokumentasi yang ada untuk VARENUM::VT_DISPATCH di pustaka MSDN.

Konstruktor

Nama Deskripsi
DispatchWrapper(Object)
Kedaluwarsa.

Menginisialisasi instans DispatchWrapper baru kelas dengan objek yang dibungkus.

Properti

Nama Deskripsi
WrappedObject
Kedaluwarsa.

Mendapatkan objek yang dibungkus oleh DispatchWrapper.

Metode

Nama Deskripsi
Equals(Object)
Kedaluwarsa.

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()
Kedaluwarsa.

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()
Kedaluwarsa.

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
MemberwiseClone()
Kedaluwarsa.

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()
Kedaluwarsa.

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk