To provide a LispWorks application with a DDE server, the following three steps should be followed: define a specialized server class using
, provide the server class with the functionality it requires by specializing methods on it and/or using
, and finally, start an instance of the server using
defines a class for a Lisp DDE server. The class inherits from
define-dde-server-function name-and-options transaction (binding *)
is used to define a server function, called
, which is called when a specific transaction occurs.
The defined function may either be attached to a server object (possibly only for a particular topic class) or to a dispatching topic object.
creates an instance of a server of the class specified by
which then starts accepting transactions. If successful the function returns the server, otherwise
You need to call
in a thread that will process Windows messages. This can either be done by using
to run it in the thread of an application's main window (if there is one) or by running it in a dedicated thread as in the example in the
LispWorks Reference Manual
. DDE callbacks will happen in this thread.
The next command line shows how to use
to define a server class called
that has the service name "
(win32:define-dde-server foo-server "FOO")
It is usual to provide the new server class with some functionality. The next command illustrates how to define a server function called
, which takes a string as an argument, and prints this to the standard output. For convenience, the system topic is used, though usually it is better to define your own topic.
(win32:define-dde-server-function (bar :topic :system)
(format t "~&~s~%" x)
can be started using
This function returns the server object, which responds to requests for conversations with the service name "
", and accepts execute transactions for the function
in the "System" topic.