UnknownWrapper Class
TOC
Collapse the table of content
Expand the table of content

UnknownWrapper Class

 

Wraps objects the marshaler should marshal as a VT_UNKNOWN.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Runtime.InteropServices.UnknownWrapper

[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class UnknownWrapper

NameDescription
System_CAPS_pubmethodUnknownWrapper(Object)

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

NameDescription
System_CAPS_pubpropertyWrappedObject

Gets the object contained by this wrapper.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft