All Manuals > LispWorks COM/Automation User Guide and Reference Manual > 3 Using Automation

NextPrevUpTopContentsIndex

3.1 Including Automation in a Lisp application

This section describes how to load Automation and generate any FLI definitions needed to use it.

3.1.1 Loading the modules

Before using any of the LispWorks Automation APIs, you need to load the module using

(require "automation")

3.1.2 Generating FLI definitions from COM definitions

Automation components and interfaces that are to be used by the Automation API must be placed in a type library using suitable tools. In some cases, this type library will be supplied as part of the DLL or executable containing the component.

Some of the Automation APIs described in this chapter require you to convert the definitions in the type library into FLI definitions. This is done by compiling and loading a system definition that references the library with the options :type :midl-type-library-file. The names in the type library are converted to Lisp symbols as specified in The mapping from COM names to Lisp symbols

Note: this is not required by all the APIs, for example see Calling Automation methods without a type library and A simple implementation of a single Automation interface.

3.1.3 Reducing the size of the converted library

Suppose you have a defsystem system definition form that references a library: that is, a system member has options :type :midl-type-library-file as described in Generating FLI definitions from COM definitions.

For this member, the option :com can be added to specify whether all the COM functionality is required. The keyword can take these values:

t

Analyze and generate all the required code for calling and implementing the interfaces from the type library. This is the default value.

nil

Analyze but do not generate any code for calling or implementing COM interfaces from the type library. It is still possible to call Automation methods.

:not-binary

Analyze but do not generate any code for calling or implementing COM interfaces from the type library. It is still possible to call Automation methods and implement dispinterfaces in the type library, but not dual or COM interfaces.

Using the value nil or :not-binary generates much smaller code and is therefore much faster. However, it is never obligatory to use the option :com.

Use :com nil when the application calls Automation interfaces from the type library but does not implement any of them or need to call any methods from dual interfaces using call-com-interface.

Use :com :not-binary when the application implements only dispinterfaces from the library. This is typically required for implementing sink interfaces for use with connection points.

For an example see (example-edit-file "com/ole/simple-container/defsys")

LispWorks COM/Automation User Guide and Reference Manual - 23 Mar 2017

NextPrevUpTopContentsIndex