Used to simplify invocation of several methods from a particular Automation interface pointer.
com
with-dispatch-interface disp dispinterface-ptr {form}* => value*
disp ::= (dispatch-function dispinterface-name)
disp |
The names of the dispatch function and Automation interface. |
dispinterface-ptr⇩ |
A form which is evaluated to yield a COM i-dispatch interface pointer. |
form⇩ |
A form to be evaluated. |
dispatch-function⇩ |
A symbol which will be defined as a macro, as if by macrolet. The macro can be used by forms to invoke the methods on dispinterface-ptr. |
dispinterface-name⇩ |
A symbol which names the Automation interface. It is not evaluated. |
value* |
The values returned by the last form. |
When the macro with-dispatch-interface
evaluates forms, the local macro dispatch-function can be used to invoked the methods for the Automation interface dispinterface-name, which should be the type or a supertype of the actual type of the Automation interface pointer dispinterface-ptr.
dispatch-function has the following signature:
dispatch-function method-name arg* => values
where:
method-name |
A symbol which names the method. It is not evaluated. |
arg |
Arguments to the method (see 3.3.3 Data conversion when calling Automation methods for details). |
values |
Values from the method (see 3.3.3 Data conversion when calling Automation methods for details). |
For example, in order to invoke the ReFormat
method of a MyDocument
interface pointer:
(with-dispatch-interface (call-doc my-document) doc (call-doc re-format))
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:41