COMVariant::createFromCOM Method [AX 2012]

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

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.

Possible values of the inOutFlag parameter are as follows:

  • COMVariantInOut::IN

  • COMVariantInOut::IN_OUT

  • COMVariantInOut::OUT

  • COMVariantInOut::OUT_RETVAL

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); 
}
Show: