Define an implementation class for a particular Automation component.




define-automation-component class-name ( superclass-name* )
( slot-specifier* )



A symbol naming the class to define.


A symbol naming a superclass to inherit from.


A slot description as used by defclass .


An option as used by defclass .


The macro define-automation-component defines a standard-class which is used to implement an Automation component. Normal defclass inheritance rules apply for slots and Lisp methods.

Each superclass-name argument specifies a direct superclass of the new class, which can be any standard-class provided that certain standard classes are included somewhere in the overall class precedence list. These standard classes depend on the other options and provide the default superclass list if none is specified. The following standard classes are available:

standard-i-dispatch is always needed and provides a complete implementation of the i-dispatch interface, based on the type information in the type library.

standard-i-connection-point-container is needed if there are any source interfaces specified (via the :coclass or :source-interfaces options). This provides a complete implementation of the Connection Point protocols.

slot-specifier s are standard defclass slot definitions.

class-option s are standard defclass options. In addition the following options are recognized:

(:coclass coclass-name )

coclass-name is a symbol specifying the name of a coclass. If this option is specified then a class factory will be registered for this coclass, to create an instance of class-name when another application requires it. The component will implement the interfaces specified in the coclass definition and the default interface will be returned by the class factory.

Exactly one of :coclass and :interfaces must be specified.

(:interfaces interface-name *)

Each interface-name specifies an Automation interface that the object will implement. The i-unknown and i-dispatch interfaces should not be specified because their implementations are automatically inherited from standard-i-dispatch . No class factory will be registered for class-name , so the only way to make instances is from with Lisp by calling make-instance .

Exactly one of :coclass and :interfaces must be specified.

(:source-interfaces interface-name *)

Each interface-name specifies a source interface on which the object allows connections to be made. If the :coclass option is also specified, then the interfaces flagged with the source attribute are used as the default for the :source-interfaces option.

When there are event interfaces, the component automatically implements the IConnectionPointContainer interface. The supporting interfaces IEnumConnectionPoints , IConnectionPoint and IEnumConnections are also provided automatically.

(define-automation-component c-test-suite-1 ()
    ((prop3 :initform nil)
     (interface-4-called :initform nil))
  (:coclass test-suite-component)
See also


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