NextPrevUpTopContentsIndex

do-connections

Macro
Summary

Iterates over the sinks for a given Automation component object.

Package

com

Signature

do-connections (( sink interface-name &key
dispatch automation-dispatch )
container )
form*

Arguments

sink

A symbol which will be bound to each sink interface pointer.

interface-name

A symbol naming the sink interface.

dispatch

A symbol which will be bound to a local macro that invokes a method from the sink interface as if by with-com-interface .

automation-dispatch

A symbol which will be bound to a local macro that invokes a method from the sink interface as if by with-dispatch-interface .

container

An instance of a component class that has interface-name as one of its source interfaces.

form

A form to be evaluated.

Description

The macro do-connections provides a way to iterate over all the sink interface pointers for the source interface interface-name in the connection point container container . The container must be a subclass of standard-i-connection-point-container . Each form is evaluated in turn with sink bound to each interface pointer. If dispatch is given, it is defined as a local macro invoking the COM interface interface-name as if by with-com-interface . If automation-dispatch is given, it is defined as a local macro invoking the Automation interface interface-name as if by with-dispatch-interface .

Within the scope of do-connections you can call the local function discard-connection which discards the connection currently bound to sink . This is useful when an error is detected on that connection, for example when the client has terminated. The signature of this local function is

discard-connection &key release

release is a boolean defaulting to nil . If release is true then release is called on sink .

Example

Suppose there is a source interface i-clonable-events with a method on-cloned . The following function can be used to invoke this method on all the sinks of an instance of a clonable-component class:

(defun fire-on-cloned (clonable-component)
  (do-connections ((sink i-clonable-events
                         :dispatch call-clonable)
                   clonable-component)
    (call-clonable on-cloned value)))
See also

with-dispatch-interface
with-com-interface
standard-i-connection-point-container


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

NextPrevUpTopContentsIndex