Basic DDE concepts

What is DDE ?

Dynamic Data Exchange is a standardised concept of inter-process communication available to applications running in Windows.

Applications can use DDE for one-time data transfers and for on-going exchanges in which one application sends updates to another as new data becomes available (advice loops).

Client and server

Dynamic data exchange always takes place between a client and a server application. The client initiates the exchange by establishing a conversation with the server so that it can request data or services from the server. A server can serve many clients at the same time, and a client can request data from several servers. Also, an application can be both a client and a server. The client terminates the conversation when it no longer needs the data or services from the server.

The DDE server

A DDE server uses a three-level hierarchy to uniquely identify data:

Level

Description

1 = Service name

can be regarded as the name of the server. The service name is unique among all servers in the system.

2 = Topic name

identifies a logical data context in the server. Levels 1 and 2 are used by the client to establish a conversation with a server.

3 = Item name

is used to name the data items available to a conversation.

As an example we use a spreadsheet program. The service name is the name of the spreadsheet program, the topic name is the name of a spreadsheet loaded into the program and the item name will be the address of one or more cells in the spreadsheet.

DDE services

A DDE server can offer one or more of the following services.

Service

Description

Request

Allows the client to read data items in the server.

 

Poke

Allows the client to change data items in the server.

 

Advice loop

 

Allows the client to subscribe to data items in the server. As long as the subscription is active, the client will be notified each time the data item changes in the server. An advice could be a message saying that the data has been changed (warm link) or a message containing the new data (hot link).

Execute

Allows the client to make the server execute commands.