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

NextPrevUpTopContentsIndex

define-dispinterface-method

Macro
Summary

The define-dispinterface-method macro is used to define a dispinterface method.

Package

com

Signature

define-dispinterface-method method-spec (class-spec . lambda-list) form* => value

method-spec ::= method-name | (interface-name method-name)

class-spec ::= (this class-name)

Arguments

method-spec

Specifies the method to be defined.

method-name

A symbol naming the method to define.

interface-name

A symbol naming the interface of the method to define. This is only required if the implementation class class-name has more than one method with the given method-name.

class-spec

Specifies the implementation class and variables bound to the object with in the forms.

this

A symbol which will be bound to the COM object whose method is being invoked.

class-name

A symbol naming the COM implementation class for which this method is defined.

lambda-list

A simple lambda list. That is, a list of parameter names.

form

Forms which implement the method. The value of the final form is returned as the result of the method.

value

The value to be returned to the caller.

Description

The macro define-dispinterface-method defines a dispinterface method that implements the method method-name for the Automation implementation class class-name. The extended method-spec syntax is required if class-name implements more than one interface with a method called method-name (analogous to the C++ syntax InterfaceName::MethodName).

The symbol this is bound to the instance of the Automation implementation class on which the method is being invoked.

The number of parameter in lambda-list must match the declaration in the type library. Each in and in-out parameter is bound to the value passed to IDispatch::Invoke, 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 missing values the value of the parameter is :not-found. For out and in-out arguments, the corresponding parameter should be set by the forms 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.

Notes

The define-com-method macro should be used to implement methods in dual interfaces.

See also

define-com-method
com-object-dispinterface-invoke


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

NextPrevUpTopContentsIndex