Method AutomationObject():callMethod() Foundation

Calls a method.

Syntax
:callMethod( <cName> | <nID> [, <xParam, ...>] ) --> xValue
Parameters
<cName>
<cName> is the name of the method.
<nID>
<nID> is the numeric ID identifying the method to be called. The ID of a method can be queried by using :getIDsOfNames().
<xParam>
xParam is a comma-separated list of parameters that is passed to the method of the connected COM/ActiveX component.
Return

The data type of the result is defined by the method that is called. In case a method is called which is not known to the COM/ActiveX component, a runtime error occurs.

Description

:callMethod() is used to call a method of an ActiveX component.

Normally, :callMethod() need not be called directly by applications. Instead, COM/ActiveX methods can be called similar to a normal Xbase++ method.

// Execute call via :callMethod() 
oAuto:callMethod( "Method", pram1, param2 ) 

is equivalent to

// Execute method directly 
oAuto:Method( param1, param2 ) 

When methods are called, then Xbase++ data types are automatically converted to/from COM/ActiveX data types as needed.

Xbase++ - COM/ActiveX data types conversion.
Xbase++ COM/ActiveX Remark
A VT_ARRAY See Note below
M VT_BSTR
C VT_BSTR
C VT_I1 The length of the string is 1
C VT_UI1 The length of the string is 1
U VT_NULL
U VT_ERROR Omitted optional parameter
L VT_BOOL
D VT_DATE
O VT_DISPATCH Xbase++ object of class AutomationObject
N VT_INT
N VT_UINT
N VT_I2
N VT_UI2
N VT_I4
N VT_UI4
N VT_I8
N VT_UI8
N VT_R4
N VT_R8
N VT_CY
N VT_DECIMAL
ANY VT_VARIANT

When the COM/ActiveX component does not provide information about what type is to be used in a method call or as a property value then conversion is done according following table:

Xbase++ COM/ActiveX
A VT_ARRAY
C VT_BSTR
U VT_NULL
L VT_BOOL
D VT_DATE
O VT_DISPATCH
N VT_I4 *)
N VT_R8 *)
  1. Depending on the precision of the numeric value.

COM/ActiveX cannot handle arrays where the array elements are of different types. In this case, the type of the first array element is considered when it comes to type conversion.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.