Dynamic data exchange (DDE) enables two applications running on the same machine to exchange information. DDE can be used to automatically update data used by one application whenever data changes in another application. Not only can the DDE feature be used to exchange data between two VisualAge applications, it can also be used to enable a VisualAge application to communicate with commercial software programs, such as spreadsheet or graphics packages.
For example, you can use DDE to send data from a VisualAge application to a spreadsheet. As users of your VisualAge application change data values, these changes can be automatically reflected in the spreadsheet. Or, DDE can be used to bring information such as up-to-the-minute international exchange rates into a VisualAge application.
The following information is also available:
A DDE client application requests and receives data from server applications. In contrast, a DDE server application uses DDE to send data to applications that have registered an interest in that data. Because DDE provides two-way communication between client and server applications, the distinctions can be somewhat vague, but here are some differences to note:
If you want to provide information to many different applications, create a DDE server application.
If you want your VisualAge application to start another application, create a DDE client application.
VisualAge DDE Client parts can communicate with only one server about one topic. However an application can use any number of DDE Client parts, and any number of DDE Server parts.
DDE uses four strings to identify all of the information you want to exchange:
A server can have an unlimited number of topics.
Topics can have an unlimited number of items.
Items can have multiple formats.
For both DDE Client and DDE Server parts, the following list explains some commonly used data formats:
Size limitations
DDE permits the transfer of many kinds of data. One limitation of DDE, however, is that the size of the data must be less than 64K bytes. Because each data transfer adds some additional header information to the data you are sending, the maximum object sizes are as follows:
The transfer of data will fail if your application tries to transfer an object larger than 64K bytes in size. The value of the lastTransferError attribute will change when an application tries to send an object larger than 64K bytes in size.
For applications to exchange data using DDE, the following must occur:
There are several attributes on the DDE Client part that enable you to start the DDE server application with the appropriate parameters, such as startProgramName and startServerExectuteString.
A communication connection is made for a single topic and a single server name. Within VisualAge, you specify the server name and topic in the Settings window for the DDE Client or DDE Server part.
The DDE client application must make the communication connection. You can use the connect action of a DDE Client part to make the connection. If an application needs to communicate on more than one topic, you need to make at least one connection for each DDE Client part.
When you make attribute-to-attribute connections between the items of a DDE Client or DDE Server part and the visual parts of your window, VisualAge automatically creates the links necessary to transfer the data.