A symbol which will be bound to each sink interface pointer.
A symbol naming the sink interface.
A symbol which will be bound to a local macro that invokes a method from the sink interface as if by with-com-interface
.
A symbol which will be bound to a local macro that invokes a method from the sink interface as if by with-dispatch-interface
.
An instance of a component class that has interface-name as one of its source interfaces.
A form to be evaluated.
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 false. If release is true then release is called on sink.
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)))
LispWorks COM/Automation User Guide and Reference Manual - 23 Mar 2017