NextPrevUpTopContentsIndex

com-object-dispinterface-invoke

Generic Function
Summary

A generic function called by IDispatch::Invoke when there is no defined dispinterface method.

Package

com

Signature

com-object-dispinterface-invoke com-object method-name
method-type args
=> value

Arguments

com-object

A COM object whose method is being invoked.

method-name

A string naming the method to be called.

method-type

A keyword specifying the type of method being called.

args

A vector containing the arguments to the method.

Description

The generic function com-object-dispinterface-invoke is called by IDispatch::Invoke when there is no method defined using define-dispinterface-method.

Methods can be written for com-object-dispinterface-invoke , specializing on an Automation implementation class and implementing the method dispatch based on method-name and method-type .

The method-name argument is a string specifying the name of the method as given by the method declaration in the IDL or type library. The method-type argument, has one of the following values:

:get

when invoking a property getter method.

:put

when invoking a property setter method.

:method

when invoking a normal method.

The arguments to the method are contained in the vector args , in the order specified by the method declaration in the type library. For in and in-out arguments, the corresponding element of args contains the argument value converted to the type specified by the method declaration and then converted to Lisp objects as specified in Data conversion when calling Automation methods. For out and in-out arguments, the corresponding element of args should be set by the method to contain the value to be returned to the caller and will be converted to an automation value as specified in Data conversion when calling Automation methods.

The value should be a value which can be converted to the appropriate return type as the primary value of the method and will be converted to an automation value as specified in Data conversion when calling Automation methods. It is ignored for methods that are declared as returning void.

Note: when using com-object-dispinterface-invoke , it is not possible to distinguish between invocations of the same method name for different interfaces when com-object implements several interfaces. If this is required, then the method must be defined with define-dispinterface-method.

Example

See the example file in

examples/com/ole/simple-container/owc-spreadsheet.lisp

See also

define-dispinterface-method


LispWorks COM/Automation User Guide and Reference Manual - 17 Jul 2006

NextPrevUpTopContentsIndex