UnknownWrapper UnknownWrapper UnknownWrapper UnknownWrapper Class

定义

警告

此 API 现已过时。

对封送处理程序应该将其作为 VT_UNKNOWN 封送的对象进行包装。Wraps objects the marshaler should marshal as a VT_UNKNOWN.

public ref class UnknownWrapper sealed
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
[System.Obsolete("UnknownWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")]
public sealed class UnknownWrapper
type UnknownWrapper = class
Public NotInheritable Class UnknownWrapper
继承
UnknownWrapperUnknownWrapperUnknownWrapperUnknownWrapper
属性

注解

仅在方法的托管签名采用对象时适用。Only applies when the managed signature of a method takes an object.

int MyMethod(Object o); //Managed signature  
    HRESULT MyMethod(VARIANT o); //COM signature  
    MyObject o = new MyObject();  
    MyMethod(o); //o gets passed as VARIANT VT_DISPATCH  
    MyMethod(new UnknownWrapper(o)); //o gets passed as VARIANT VT_UNKNOWN  

构造函数

UnknownWrapper(Object) UnknownWrapper(Object) UnknownWrapper(Object) UnknownWrapper(Object)

使用要被包装的对象初始化 UnknownWrapper 类的新实例。Initializes a new instance of the UnknownWrapper class with the object to be wrapped.

属性

WrappedObject WrappedObject WrappedObject WrappedObject

获取此包装包含的对象。Gets the object contained by this wrapper.

方法

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

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

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

作为默认哈希函数。Serves as the default hash function.

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

获取当前实例的 TypeGets the Type of the current instance.

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

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

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

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于