Dynamic Data Exchange  
Top  Previous  Next

This chapter applies to establishing DDE communication with ImageWarp. It is intended for developers who are willing to write their own application while taking an advantage of ImageWarp's functionality. Provided are examples of DDE programming in C and Visual Basic.

Dynamic Data Exchange (DDE) is one of the mechanisms of interprocess communication supported under Windows. DDE is based on the messaging system built into Windows. Two Windows programs carry on a DDE conversation by posting messages to each other. These two programs are known as the DDE server and DDE client. A DDE server is the program that has access to data that may be useful to other Windows programs. A DDE client is the program that obtains this data from the server.

A client must be able to identify the type of data it wants. This is done with three character strings: service name, topic name, and Item name. A service name is a string a service application responds to when a client attempts to establish a conversation with a server. It is typically the server's executable name without extensions, i.e. "EXCEL", "MSACCESS", "IMAGEWARP", etc. The topic is usually one of several subjects around which the DDE conversation revolves. Typical topics include: "SYSTEM", "CPWAIT", "CPNOWAIT", form captions, and filenames if the application operates on files. A client must specify a topic name along with a server's service name when it attempts to establish a conversation with a server. An item is a string that identifies a unit of data a server can pass to a client during a transaction. It typically identifies the contents of system variables, controls, or fields in a form, application, or document.

A DDE client application initiates the exchange by establishing a conversation with the server to send transactions to the server. A transaction is a request for data and services The DDE server application responds to transactions by providing data or services to the client. The client can establish a hot link to the server, in which case the server will notify the client when the data related to the item of interest has changed.

The following set of standard functions is used by a DDE client during a DDE session:

DDE Item  
Description  
Chan = DDEInitiate(app$, topic$)  
Establishes a DDE conversation.  
DDERequest chan, item$, var[$] [,format$]  
Requests a data item from the server with var[$] as the return value.  
DDEPoke chan, item$, var[$] [,format$]  
Sends unrequested information over a link with var[$] as the send value.  
DDEExecute chan, command$  
Executes a command.  
DDEAdvise chan, item$, var[$] [,format$]  
Establishes a hot link with var[$] as the return value of the link.  
DDEUnadvise chan, item$ ,[var[$]]  
Terminates a hot link.  
DDETerminate [chan]  
Terminates the conversation.  
 

where:

chan
the unique channel over which the conversation takes place.
item$
the data item.
var[$]
numeric or string variable.
format$
one of a list of supported types of formatting, such as CSV or TEXT.
command$
A command that can be interpreted by the command processor.
app$
the application name (or service name).
topic$
the topic (or subject).