Used to simplify invocation of several methods from a given COM object.
com
with-com-object disp object {form}* => values
disp ::= (dispatch-function class-name &key interface)
| disp |
The names of the dispatch function and object class. |
| object⇩ |
A form which is evaluated to yield a COM object. |
| form⇩ |
A form to be evaluated. |
| dispatch-function⇩ |
A symbol. |
| class-name⇩ |
A symbol which names the COM implementation class. It is not evaluated. |
| interface⇩ |
A form. |
| values⇩ |
The values returned by the last form. |
The macro with-com-object evaluates each form in a lexical environment where dispatch-function is defined as a local macro.
dispatch-function can be used to invoked the methods on object for the COM class class-name, which should be the type or a supertype of the actual type of object.
dispatch-function has the following signature:
dispatch-function method-spec arg* => values
method-spec ::= method-name | (interface-name method-name)
where:
| method-spec |
Specifies the method to be called. It is not evaluated. |
| method-name |
A symbol naming the method to call. |
| interface-name | |
| arg |
Arguments to the method (see 1.10.1 Data conversion when calling COM object methods for details). |
|
Values from the method (see 1.10.1 Data conversion when calling COM object methods for details). |
If interface is supplied, it should be a form that, when evaluated, yields a COM interface pointer. This is only needed if the definition of the method being called has the :interface keyword in its class-spec.
Note that, because with-com-object requires a COM object, it can only be used by the implementation of that object. All other code should use with-com-interface with the appropriate COM interface pointer.
(with-com-object (call-my-doc doc-impl) my-doc (call-my-doc move 0 0) (call-my-doc resize 100 200))
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38