A LispWorks client can set up an advise loop across a conversation using
, which takes a
designator pair in the case of an automatically managed conversation using
, and a
as its main arguments. The
argument defaults to the conversation name, and can be used to distinguish between multiple advise loops established on the same service/topic/item group.
dde-advise-start conversation item &key key function format datap type
function sets up an advise loop for the data item specified by
on the specified
dde-client-advise-data key item data &key &allow-other-keys
The generic function
is the default function called when an advise loop informs a client that the data monitored by the loop has changed. By default it does nothing, but it may be specialized on the object used as the key in
, or on a client conversation class if the default key is used.
define-dde-client name &key service class
defines a mapping from the symbol
to the DDE service name with which to establish a conversation, and the conversation class to use for this conversation. The argument
is a string which names the DDE service. It defaults to the print-name of
. The argument
is a subclass of
which is used for all conversations with this service. It defaults to
. Specifying a subclass allows various aspects of the behavior of the conversation to be specialized.
The following is an example of how to set up an advise loop. The first step defines a client conversation class, called
(defclass my-conv (dde-client-conversation)
can now be used to define a specific instance of the
class for referring to a server application that responds to the service name "
(win32:define-dde-client :foo :service "FOO" :class my-conv)
The next step defines a method on
which returns a string stating that the item has changed.
(defmethod dde-client-advise-data ((self my-conv) item data &key
(format t "~&Item ~s changed to ~s~%" item data))
Finally, the next command starts the advise loop on the server
, with the topic name "
", to monitor the item "
(win32:dde-advise-start* :foo "file1" "slot1")
When the value of the item specified by "
"" changes, the server calls
which returns a string, as described above.
specifies the function called by the advise loop when it notices a change to the item it is monitoring. The function is
by default. A different function can be provided, and should have a lambda list similar to the following:
key item data &key conversation &allow-other-keys
identify the advise loop, or link. The argument
contains the new data for hot links; for warm links it is
Advise loops are closed using
dde-advise-stop conversation item &key key format errorp
removes a particular link from
is the last key for the
pair, the advise loop for the pair is terminated.