All Manuals > COM/Automation User Guide and Reference Manual > 1 Using COM

1.10 Calling COM object methods from Lisp

Within the implementation of a COM object, the macros call-com-object and with-com-object can be used to call COM methods directly for a COM object without using an interface pointer. To call a COM method, you need to specify the class name, the method name, the interface name if the method name is not unique, a COM object and suitable arguments. The class name is a symbol as used in the define-com-implementation form and can be a superclass of the actual object class. The method and interface names are given as symbols named as in 1.3 The mapping from COM names to Lisp symbols. and the arguments and values are as specified below in 1.10.1 Data conversion when calling COM object methods. These macros should be used with caution because they assume that the caller knows the implementation's pass-style for all the arguments.

The with-com-object macro is useful when several methods are being called with the same COM object, because it establishes a local macro that takes just the method name and arguments.

1.10.1 Data conversion when calling COM object methods

No explicit argument or return value conversion is done by call-com-object or with-com-object. As a result, every argument must be passed as a positional argument and must be of the type expected by the method's implementation The allowable types are described in the following sections.

1.10.1.1 In parameters

For in parameters:

1.10.1.2 Out parameters

For out parameters:

1.10.1.3 In-out parameters

For in-out parameters:


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38