Salesforce

COMObjCreate (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

COMObjCreate (Magic xpa 3.x)

You can manually create an instance of a COM object based on a variable that defines the object's details. The COMObjCreate function can be executed only for an OLE variable that has the Instantiation property set to None.

Syntax:

COMObjCreate(variable)

Parameters:

variable – A value representing a variable index within the Variable list.

Returns:

Zero (0) is returned when the function succeeds.

A negative number is returned when the function fails.

The negative numbers that the function can return are:

-1 – The attribute is not an OLE variable.

-2 – The Instantiation property of the defined variable is set as Automatic and not as None.

-3 – The object has already been loaded by the defined variable.

-4 – Undetermined failure.

The COM's handle can only be retrieved by the COMHandleGet function.

Note:

  • The function receives a variable reference ('A'VAR)

  • The function should be used in an Update operation and cannot be used in an Evaluate operation.

  • Any COM object loaded manually must be released manually. The Magic xpa engine does not automatically release objects that were loaded by this function. Use the COMObjRelease function to release manually loaded objects.

Reference
Attachment 
Attachment