UnknownWrapper 類別

定義

警告

此 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
繼承
UnknownWrapper
屬性

備註

只有在方法的 managed 簽章接受物件時才適用。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 類別的新執行個體。Initializes a new instance of the UnknownWrapper class with the object to be wrapped.

屬性

WrappedObject

取得這個包裝函式所包含的物件。Gets the object contained by this wrapper.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於