Редагувати

Поділитися через


UnknownWrapper Class

Definition

Caution

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

Wraps objects the marshaler should marshal as a VT_UNKNOWN.

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

Remarks

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  

Constructors

UnknownWrapper(Object)

Initializes a new instance of the UnknownWrapper class with the object to be wrapped.

Properties

WrappedObject

Gets the object contained by this wrapper.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to