COMVariant.iUnknown Method

Definition

Overloads

iUnknown(Int64)
iUnknown()

Gets or sets the value of a COMVariant object of the VT_UNKNOWN (IUnknown) data type.

iUnknown(Int64)

public:
 virtual long iUnknown(long _newValue);
public virtual long iUnknown (long _newValue);
abstract member iUnknown : int64 -> int64
override this.iUnknown : int64 -> int64
Public Overridable Function iUnknown (_newValue As Long) As Long

Parameters

_newValue
Int64

The new value; optional.

Returns

Applies to

iUnknown()

Gets or sets the value of a COMVariant object of the VT_UNKNOWN (IUnknown) data type.

public:
 virtual long iUnknown();
public virtual long iUnknown ();
abstract member iUnknown : unit -> int64
override this.iUnknown : unit -> int64
Public Overridable Function iUnknown () As Long

Returns

The current value.

Remarks

If you pass in a value that has a different data type than the object, the data type of the object will be changed to match the data type value. A COMVariant object has an IUnknown data type if its data type is set to COMVariantType::VT_UNKNOWN. The IUnknown data type is a COM data type that provides a handle to a COM IUnknown interface.

The following example creates a new COMVariant object of type VT_UNKNOWN.

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_UNKNOWN); 
    COMInterface comInterface; 
    // comInterface variable is assigned 
    // a COM IUnknown interface 
    // ... 
    // Set value of the object 
    var.iUnknown(comInterface); 
}

Applies to