Share via


COMVariant::createFromCOM Method

Creates a new COMVariant object and initializes it with a COM class in one operation.

Syntax

client server public static COMVariant createFromCOM(COM value, [COMVariantInOut inOutFlag])

Run On

Called

Parameters

  • value
    Type: COM Class
    The COM class value that is used to initialize the object.
  • inOutFlag
    Type: COMVariantInOut Enumeration
    A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional.
    Possible values are:

Return Value

Type: COMVariant Class
The new COMVariant object.

Remarks

Possible values of the inOutFlag parameter are as follows:

  • COMVariantInOut::IN

  • COMVariantInOut::IN_OUT

  • COMVariantInOut::OUT

  • COMVariantInOut::OUT_RETVAL

Examples

The following example creates a new COMVariant object and initializes it with a COM object.

{ 
    COMVariant var; 
    COM com = new COM("MyCOM.Object"); 
  
    var = COMVariant::createFromCOM(com); 
}

See Also

COMVariant Class

COM Class

COMVariant.new Method