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.
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.
string
attribute, the value can be a Lisp string.BSTR
, the value can be a Lisp string.size_is
attribute, the value can be a Lisp array of the appropriate rank and dimension.nil
is passed, the value from the method is returned without any conversion.size_is
attribute, the value can be a Lisp array. The contents of the array will be modified by the method and the array will be returned as a value.size_is
attribute, the value can be a Lisp array. The contents of the array will be modified by the method and the array will be returned as a value.string
attribute, the parameter can be a Lisp string. The value of the parameter at the end of the body will be returned as a value.BSTR*
, the parameter can be a Lisp string. The value of the parameter at the end of the body will be returned as a value.VARIANT*
, the parameter can be any Lisp object. The value of the parameter at the end of the body will be returned as a value.COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38