NextPrevUpTopContentsIndex

invoke-dispatch-method

Function
Summary

Call a dispatch method from an interface pointer.

Package

com

Signature

invoke-dispatch-method dispinterface-ptr name &rest args => values

Arguments

dispinterface-ptr

An Automation interface pointer.

name

A string or integer.

args

Arguments passed to the method.

Values

values

Values returned by the method.

Description

The function invoke-dispatch-method is used to invoke an Automation method from Lisp without needing to compile a type library as part of the application. This is similar to using

Dim var as Object
var.Method(1,2)

in Microsoft Visual Basic and contrasts with the macro call-dispatch-method which requires a type library to be compiled.

The dispinterface-ptr should be a COM interface pointer for the i-dispatch interface. The appropriate Automation method, chosen using name , which is either a string naming the method or the integer id of the method. The args are converted to Automation values and are passed as the method's in and in-out parameters in the order in which they appear. The values returned consist of the primary value of the method (if not void) and the values of any out or in-out parameters. See Data conversion when calling Automation methods for more details. If there is no Automation method with the given name, then a property getter with the same name is called if it exists, otherwise an error is signaled. The setf form of invoke-dispatch-method can be used to call property setter methods.

Example

For example, in order to invoke the ReFormat method of an interface pointer in the variable doc :

(invoke-dispatch-method doc "ReFormat")
See also

invoke-dispatch-get-property
invoke-dispatch-put-property
call-dispatch-method


LispWorks COM/Automation User Guide and Reference Manual - 21 Feb 2008

NextPrevUpTopContentsIndex