Method AutomationObject():invoke() Foundation

Invokes a method or property.

:invoke( <cName> | <nID>, <nNamedArgs>, <nFlags> [, <xParam, ...>] ) --> xValue
<cName> is the name of the method or property to invoke.
<nID> is the ID of the name or property to invoke and can be queried by the method :getIDsOfNames().
<nNamedArgs> is a numeric value. It must be one (1) in case one value shall be assigned to a property. It must be zero (0) for retrieving a value from a property or if a method is to be called.
<nFlags> is a combination of constants specifying the operation to be performed by :invoke().
Values for nFlags
Constant Usage
DISPATCH_METHOD Call a method or set a property with more then one parameter
DISPATCH_PROPERTYGET Get a property value
DISPATCH_PROPERTYPUT Set a property value
DISPATCH_PROPERTYPUTREF Set a property value by reference
  1. defined in
<xParam> is a comma separated list of arguments to be forwarded to the element specified in <cName> or <nID>.

The result depends on the return value of the method or property that is invoked. In case a method or property is invoked which is not known to the ActiveX component, a runtime error occurs.


:invoke() can be used to accessing elements of a COM/ActiveX object. This element can be either a method or a property. A property can be invoked for read or write access.

Normally, :invoke() does not need to be called directly. The methods :callMethod(), :setProperty() or :getProperty() should be used instead.

When methods are called or properties are accessed, then Xbase++ data types are automatically converted to/from COM/ActiveX data types. See the method:callMethod() for further reference.


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.