COMVariant.iUnknown Method
Gets or sets the value of a COMVariant object of the VT_UNKNOWN (IUnknown) data type.
Syntax
public ComInterface iUnknown([ComInterface newValue])
Run On
Called
Parameters
- newValue
Type: ComInterface Extended Data Type
The new value; optional.
Return Value
Type: ComInterface Extended Data Type
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.
Examples
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);
}