Defines a dispinterface method.
com
define-dispinterface-method method-spec (class-spec . lambda-list) {form}* => value
method-spec ::= method-name | (interface-name method-name)
class-spec ::= (this class-name)
method-spec⇩ |
Specifies the method to be defined. |
class-spec |
Specifies the implementation class and variables bound to the object with in forms. |
lambda-list⇩ |
A simple lambda list. That is, a list of parameter names. |
form⇩ |
Forms which implement the method. The value of the final form is returned as the result of the method. |
method-name⇩ |
A symbol naming the method to define. |
interface-name⇩ |
A symbol naming the interface of the method to define. This is only required if the implementation class class-name has more than one method with the given method-name. |
this⇩ |
A symbol which will be bound to the COM object whose method is being invoked. |
class-name⇩ |
A symbol naming the COM implementation class for which this method is defined. |
value⇩ |
The value to be returned to the caller. |
The macro define-dispinterface-method
defines a dispinterface method that implements the method method-name for the Automation implementation class class-name. The extended method-spec syntax containing interface-name is required if class-name implements more than one interface with a method called method-name (analogous to the C++ syntax InterfaceName::MethodName
).
When the method is called, each form is evaluated in a lexical environment containing the following bindings.
The symbol this is bound to the instance of the Automation implementation class on which the method is being invoked.
The number of parameter in lambda-list must match the declaration in the type library. Each in and in-out parameter is bound to the value passed to IDispatch::Invoke
, converted to the type specified by the method declaration and then converted to Lisp objects as specified in 3.3.3 Data conversion when calling Automation methods. For missing values the value of the parameter is :not-found
. For a parameter marked with the vararg
attribute, the value will be an array of the values passed in the call. For out and in-out arguments, the corresponding parameter should be set by the forms to contain the value to be returned to the caller and will be converted to an automation value as specified in 3.3.3 Data conversion when calling Automation methods.
value should be a value which can be converted to the appropriate return type as the primary value of the method and will be converted to an automation value as specified in 3.3.3 Data conversion when calling Automation methods. It is ignored for methods that are declared as returning void.
The define-com-method macro should be used to implement methods in dual interfaces.
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:41