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

call-com-interface Macro

Summary

Invokes a method from a particular COM interface.

Package

com

Signature

call-com-interface spec {arg}* => value*

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

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

The macro call-com-interface invokes the method method-name for the COM interface interface-name, which should the type or a supertype of the actual type of interface-ptr. args and value* are described in detail in 1.8.1 Data conversion when calling COM methods.

Examples

This example invokes the COM method GetTypeInfo in the interface IDispatch.

(defun get-type-info (disp tinfo &key
                      (locale LOCALE_SYSTEM_DEFAULT))
  (multiple-value-bind (hres typeinfo)
      (call-com-interface
          (disp i-dispatch get-type-info)
          tinfo locale)
    (check-hresult hres 'get-type-info)
    typeinfo))
See also

with-com-interface
query-interface
add-ref
release


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