The example shows you how to set up an advise loop. The code assumes that
package symbols are visible.
The first step defines a client conversation class, called
(defclass my-conv (dde-client-conversation)
The function define-dde-client can now be used to define a specific instance of the
class for referring to a server application that responds to the service name "
(define-dde-client :foo :service "FOO" :class my-conv)
The next step defines a method on dde-client-advise-data 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 "
(dde-advise-start* :foo "file1" "slot1")
When the value of the item specified by "
"" changes, the server calls dde-client-advise-data which returns a string, as described above.
The function argument of dde-advise-start and dde-advise-start* specifies the function called by the advise loop when it notices a change to the item it is monitoring. The function is dde-client-advise-data 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 or dde-advise-stop*.