Dynamic data exchange is a protocol that Windows provides for transferring data between applications. It is a set of guidelines and messages that is useful in sending messages between different applications that share the same memory. Candidates applying for job roles in the software department can benefit from learning the basics of dynamic data exchange. In this article, we define “What is dynamic data exchange?”, explain how it works and discuss the steps to use this protocol with windows.
What is dynamic data exchange?
The dynamic data exchange (DDE) protocol is a communication bridge that Microsoft introduced in Windows in 1987. DDE protocol is a common method that facilitates inter-process communication between various software and applications. With the help of DDE guidelines, applications can share data in the Windows operating system. DDE can be a great communication method in the absence of user interaction. There are various applications like Excel and Word that use this message-driven protocol. This may work by establishing a conversation between applications including the one with data and another that requests data.
DDE protocol also allows applications to send or read data in real-time. DDE also has various uses in implementing different application features. Some of these features include linking applications to real-time data. For example, many applications use the DDE protocol to provide stock market updates. Other uses of DDE include preparing documents with charts. For example, certain applications may provide factual statistics and real-time data through documents. If the source data changes, the DDE can automatically update the data without influencing the rest of the document. DDE can also help in performing data queries.
How does dynamic data exchange work?
DDE has a major use in transferring information in conversations. This message-driven protocol conducts its communications in the background which means a user can do whatever they are doing even during the execution of a DDE request. In the Windows operating system, various applications benefit from the DDE protocol as it helps them transfer data for one-time and then provide regular updates if new data becomes available.
Many applications also use a dynamic data exchange management library (DDEML) that provides functions to manage DDE conversations. It basically simplifies the implementation of the DDE protocol. Without DDEML, DDE messages get directly posted and processed. Here are some terms along with an explanation of how a DDE protocol works:
DDE client and DDE server
In a conversation, an application requesting data is a DDE client while the one responding to the client and sending data is the DDE server. It is the DDE client who initiates a conversation with the DDE server. In a DDE conversation, the DDE client may send a transaction which can be a request for necessary services or data to the server application. The DDE server application can then respond to transactions and provide data or services to the client.
DDE conversation
A DDE conversation is the communication between two types of applications named client and server. When a specific application gets loaded, it may communicate with DDE that its services or data are available. Then another application which can be a client may initiate a conversation. In simpler terms, this process can be similar to a telephone conversation. Once a DDE conversation starts, the DDE client can request or share data with the DDE server.
DDE messages
DDE messages can be of different types like request, advice, poke and execute messages. DDE client applications may use a request message to retrieve data from the DDE server. With a request message, applications can only retrieve information and are unable to perform any actions. Another common DDE message that applications can use is an advice message. It allows them to receive feedback and updates.
In a DDE conversation, the updates that an advice message provides are hot and warm links. With the help of hot and warm links, a client application can receive updates whenever a specific event occurs. Hot links can provide automatic up-to-date information to applications.
System topic, item and topic name
A system topic tells about the general interest of a DDE client. Usually, server applications support the system topic. It gets associated with a data item that helps users to locate information about the system. For example, a user can take help from a data item and find the sessions that are currently in use. Users can request such information with a request command.
A topic name is a string that helps in the identification of a data context. For example, if a server is operating on file-based documents then it may have a topic name related to the filename. Whenever a DDE client application initiates a DDE conversation, it may require specifying the topic name and the service name of the server. A unit of data that a server passes to the client can get identified by an item name. It may identify text, an integer or a string.
Steps to use DDE protocol with Windows
Here are some steps that can help you use a DDE protocol with Windows:
- Implement DDE server
Windows users can implement the DDE server with the help of the following steps:
- Initiate the DDE subsystem: Users can initiate the DDE subsystem by using a DDE-initialise function. This function allows an application to register with the DDEML.
- Prepare string for topics: The second step involves using a DDE-CreateStringHandle function. It helps in the identification of a string for a topic. A DDE server application can later transfer this string as a parameter.
- Check the availability of topic names: Users can check if they are the only server with a particular topic name. A function called DDEconnect can help in finding any server with the same topic name. Users may only proceed to the next step if they have a unique server or topic name.
- Register the server: A DDENameService function can help in registering the server with the DDE subsystem. This function allows the system to send the register and unregister transactions or updates to DDEML.
- Process transactions: After the registration of a DDE server, users can receive and process transactions in DDE-callback. Whenever a DDE client initiates a conversation with a server, DDE-callback can both accept and deny the conversation. It can send ‘TRUE’ to DDEML for allowing the conversation or send ‘FALSE’ to deny the conversation.
- Unregister the DDE server: Users can also unregister the DDE server by using the DDE-uninitialise function. This function breaks the association with a system that fails the processing of client requests.
- Implement DDE client
In the beginning, a few steps for the implementation of a DDE client can be similar to that of a DDE server. Here are the steps to implement a DDE client in the Windows operating system:
- Initiate the DDE subsystem: The first step to implementing a DDE client application may involve using the DDE-initialise function to link with the DDE subsystem.
- Prepare strings for topics: After linking with the DDE subsystem, users can create string handles with the help of the DDECreateStringHandle function.
- Connect with DDE server: By using the DDE-connect function, a client application can get connected to the DDE server. This connection can only establish with the server that has specific topic names.
- Use DDE messages: After the establishment of a connection between the DDE client and server, the client can request, poke or execute data by using the DDEClientTransaction function.
- End the DDE conversation: Users can also disconnect the DDE client from the server by using the DDE-disconnect function which breaks the link between a client and the DDE subsystem. It may also free all the DDEML resources associated with the client.
Common uses of DDE
Here are some common examples of using a DDE protocol:
- analysing data or information from Microsoft Word
- invoking commands in DDE-compatible software or applications
- reading missing data from a sheet
- writing or updating data to an Excel spreadsheet


