DDE Application (DDEApp) is a Dynamic Data Exchange (DDE) based inter-process communication protocol created to exchange data and perform functions call between applications.
Back in 2009, when I was still programming in Borland C++ Builder, I needed to find a solution to call function remotely between two applications. We had decided to make use of DDE for this purpose. Using VCL control in Borland, we managed to get DDE up within few days. However, soon we realized that existing DDE protocol was not able to fully meet our requirement.
DDEApp a command line inter-process communication protocol implemented based on DDE. It contains a client and host class named as below.
An overview of the classes is shown as below. DDEApp Client is designed to handle multiple clients.
Actual inter-process communication took place in DDE Server and Client class.
Hide low level settings from userThere are several parameters that need to be set correctly in DDE Server and Client class before two process can "talk" to each other using DDE. Client needs to know the server's setting upfront. User must figure out these settings either from code or documentation to establish DDE connection with Server.
DDEApp hide all DDE related parameters from user. User who use DDEApp did not need any knowledge with DDE. A standard sets of setting will be used for all DDEApp Server and Client instances. This means that all DDEApp Servers and Clients can communicate with each others.
Support multiple clients and serversDDEApp Client and Server is designed to handle multiple clients and servers. A DDEApp Client can connect to multiple servers while a DDEApp Server is able to handle respond from multiple clients.
DDEApp ProtocolTo ensure the correct message is passed between selected server and client, DDEApp implemented a command line message protocol which contains information of sender and receiver as below.
<Source> <Dest> <Commands>
- Source : Sender application's EXE name.
- Dest: Receiver application's EXE name.
- Commands: DDEApp commands
Cross platform (C++ / C#)As an inter-process communication protocol, DDEApp allows application build from different platform (e.g. Borland Builder 5, Borland Builder 6, Visual C#) to communicate with each other. This is useful for mid to large scale projects when code conversion from one platform to another is time consuming and expensive.
Standard functionsDDEApp Server included a list of common functions to remotely control the server's application.
Function listsThe "Help" function shows above is an internal function created to return list of registered functions and variables from DDEApp Server. With this features, we are able to get most updated functions and variables list which may change from version to version. This is much better than any external documentation.
Image below shows list of functions and variables in DDEApp Client terminal returned from a DDEApp enabled server application.
Function call with error reportingAll function call from DDEApp Client to DDEApp Server are made via FunctionCall(). Client will receive execution status upon completion of the functions. FunctionCall() is available in both synchronous and asynchronous version.
Image below shows an example of DDEApp function call which return without error.
Besides, it also shows additional info sent from DDEApp Server when executing function.
This is another example shows failed function call which returned an error message.
Variable Read / WriteVariable read or write are done in a similar way as function call except that variable are either read and write or just read only. Read or write to variable is synchronous call using VariableRead() and VariableWrite().
Connect / Disconnect / Shut DownDDEApp Client can be connect or disconnect from DDEApp Server when required using function Connect() and Disconnect(). Server will get notify when a client is connected or disconnected.
Besides, the client can request server to shut down using ShutDownServer() function. An OnClientShutdownQuery event will be raised at server application. Server has full authority to decide whether to proceed to shutdown itself.
Online / OfflineOnline() and Offline() are two functions dedicated for DDEApp Server to enable or disable DDEApp protocol. When server is offline, none of the client is allowed to connect to the server. Any client that was connected earlier will received a OnLinkClosed event.
DEMO and Tutorial
- DDEApp Borland C++ Library + Source Code.[Download - Github]
- DDEApp .NET Assembly + Source Code. [Download - Github]
- DDE Application (Client Terminal). [Download - Github]
- DDEApp Tutorial
If you were not able to run the executable file, pleas get the re-distributed library from below.
- Borland C++ Builder 6 libraries. [Download - Github]
- Borland Developer Studio 2006 libraries. [Download - Github]