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

NextPrevUpTopContentsIndex

with-dispatch-interface

Macro
Summary

Used to simplify invocation of several methods from a particular Automation interface pointer.

Package

com

Signature

with-dispatch-interface disp dispinterface-ptr form* => values

disp ::= (dispatch-function dispinterface-name)

Arguments

disp

The names of the dispatch function and Automation interface.

dispatch-function

A symbol which will be defined as a macro, as if by macrolet. The macro can be used by the forms to invoke the methods on dispinterface-ptr.

dispinterface-name

A symbol which names the Automation interface. It is not evaluated.

dispinterface-ptr

A form which is evaluated to yield a COM i-dispatch interface pointer.

form

A form to be evaluated.

Values

values

The values returned by the last form.

Description

When the macro with-dispatch-interface evaluates the 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.

The dispatch-function macro 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 Data conversion when calling Automation methods for details).

values

Values from the method (see Data conversion when calling Automation methods for details).

Example

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))
See also

call-dispatch-method

 


LispWorks COM/Automation User Guide and Reference Manual - 14 Feb 2015

NextPrevUpTopContentsIndex