DispatchWrapper 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
DispatchWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.
对封送处理程序应该将其作为 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
		- 继承
 - 
				DispatchWrapper
 
- 属性
 
注解
使用 包装封送处理程序应封送为 VT_DISPATCH的对象。 此包装器将强制将对象封送为 VT_DISPATCH。 如果 对象不支持 IDispatch ,则会引发异常。
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
有关 的详细信息 VT_DISPATCH,请参阅 MSDN 库中的现有文档 VARENUM::VT_DISPATCH 。
构造函数
| DispatchWrapper(Object) | 
			 
				已过时.
			 
		使用正在包装的对象初始化 DispatchWrapper 类的新实例。  | 
        	
属性
| WrappedObject | 
			 
				已过时.
			 
		获取由 DispatchWrapper 包装的对象。  | 
        	
方法
| Equals(Object) | 
			 
		已过时.
	 
确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
			 
		已过时.
	 
作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
			 
		已过时.
	 
获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
			 
		已过时.
	 
创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
			 
		已过时.
	 
返回表示当前对象的字符串。 (继承自 Object) |