All Manuals > COM/Automation User Guide and Reference Manual > 4 Automation Reference Entries

call-dispatch-method Macro

Summary

Calls an Automation method from a particular interface.

Package

com

Signature

call-dispatch-method spec {arg}* => value*

spec ::= (dispinterface-ptr dispinterface-name method-name)

Arguments
spec
The interface pointer and a specification of the method to be called.
arg
Arguments to the method (see 3.3.3 Data conversion when calling Automation methods for details).
dispinterface-ptr
A form which is evaluated to yield a COM i-dispatch interface pointer.
dispinterface-name
A symbol which names the Automation interface. It is not evaluated.
method-name
A symbol which names the method. It is not evaluated.
Values
value*
Values from the method (see 3.3.3 Data conversion when calling Automation methods for details).
Description

The macro call-dispatch-method is used to invoke an Automation method from Lisp.

dispinterface-ptr should be a COM interface pointer for the i-dispatch interface.

The appropriate Automation method, chosen using dispinterface-name and method-name, is invoked after evaluating each arg, which must be values that are suitable for the method and of types compatible with Automation.

The values returned are as specified by the method signature. See 3.3.3 Data conversion when calling Automation methods for more details.

If there is no Automation method with the given method-name, then a property getter with the same name is called if it exists, otherwise an error is signaled.

The setf form of call-dispatch-method can be used to call property setter methods.

Examples

For example, in order to invoke the ReFormat method of a MyDocument interface pointer:

(call-dispatch-method (doc my-document re-format))
See also

with-dispatch-interface
call-dispatch-get-property
call-dispatch-put-property


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