Dynamic Data Exchange Management Library

Dynamic Data Exchange (DDE) is a form of interprocess communication that uses shared memory to exchange data between applications. Applications can use DDE for one-time data transfers and for ongoing exchanges and updating of data.

In This Section

Name Description
About the DDEML Discusses dynamic data exchange.
Basic Concepts Discusses key concepts concerning dynamic data exchange.
Conversation Management Discusses conversations between a client and a server.
Data Management Discusses how memory objects pass data from one application to another.
Monitoring Applications Discusses how elements of the Dynamic Data Exchange Management Library can be used to create an application that monitors dynamic data exchange activity in the system.
Name Service Discusses how the Dynamic Data Exchange Management Library makes it possible for a server application to register the service names that it supports.
Transaction Management Discusses how a client can send transactions to obtain data and services from the server.
DDEML Reference Contains the API reference.

DDEML Functions

Name Description
DdeAbandonTransaction Abandons the specified asynchronous transaction and releases all resources associated with the transaction.
DdeAccessData Provides access to the data in the specified DDE object. An application must call the DdeUnaccessData function when it has finished accessing the data in the object.
DdeAddData Adds data to the specified DDE object. An application can add data starting at any offset from the beginning of the object. If new data overlaps data already in the object, the new data overwrites the old data in the bytes where the overlap occurs. The contents of locations in the object that have not been written to are undefined.
DdeCallback An application-defined callback function used with the Dynamic Data Exchange Management Library (DDEML) functions. It processes DDE transactions. The PFNCALLBACK type defines a pointer to this callback function. DdeCallback is a placeholder for the application-defined function name.
DdeClientTransaction Begins a data transaction between a client and a server. Only a DDE client application can call this function, and the application can use it only after establishing a conversation with the server.
DdeCmpStringHandles Compares the values of two string handles. The value of a string handle is not related to the case of the associated string.
DdeConnect Establishes a conversation with a server application that supports the specified service name and topic name pair. If more than one such server exists, the system selects only one.
DdeConnectList Establishes a conversation with all server applications that support the specified service name and topic name pair. An application can also use this function to obtain a list of conversation handles by passing the function an existing conversation handle.
DdeCreateDataHandle Creates a DDE object and fills the object with data from the specified buffer. A DDE application uses this function during transactions that involve passing data to the partner application.
DdeCreateStringHandle Creates a handle that identifies the specified string. A DDE client or server application can pass the string handle as a parameter to other Dynamic Data Exchange Management Library (DDEML) functions.
DdeDisconnect Terminates a conversation started by either the DdeConnect or DdeConnectList function and invalidates the specified conversation handle.
DdeDisconnectList Destroys the specified conversation list and terminates all conversations associated with the list.
DdeEnableCallback Enables or disables transactions for a specific conversation or for all conversations currently established by the calling application.
DdeFreeDataHandle Fees a DDE object and deletes the data handle associated with the object.
DdeFreeStringHandle Frees a string handle in the calling application.
DdeGetData Copies data from the specified DDE object to the specified local buffer.
DdeGetLastError Retrieves the most recent error code set by the failure of a DDEML function and resets the error code to DMLERR_NO_ERROR.
DdeImpersonateClient Impersonates a DDE client application in a DDE client conversation.
DdeInitialize Registers an application with the Dynamic Data Exchange Management Library (DDEML). An application must call this function before calling any other DDEML function.
DdeKeepStringHandle Increments the usage count associated with the specified handle. This function enables an application to save a string handle passed to the application's DDE callback function. Otherwise, a string handle passed to the callback function is deleted when the callback function returns. This function should also be used to keep a copy of a string handle referenced by the CONVINFO structure returned by the DdeQueryConvInfo function.
DdeNameService Registers or unregisters the service names a DDE server supports. This function causes the system to send XTYP_REGISTER or XTYP_UNREGISTER transactions to other running Dynamic Data Exchange Management Library (DDEML) client applications.
DdePostAdvise Sends an XTYP_ADVREQ transaction to the calling (server) application's DDE callback function for each client with an active advise loop on the specified topic and item. A server application should call this function whenever the data associated with the topic name or item name pair changes.
DdeQueryConvInfo Retrieves information about a DDE transaction and about the conversation in which the transaction takes place.
DdeQueryNextServer Retrieves the next conversation handle in the specified conversation list.
DdeQueryString Copies text associated with a string handle into a buffer.
DdeReconnect Enables a client Dynamic Data Exchange Management Library (DDEML) application to attempt to reestablish a conversation with a service that has terminated a conversation with the client. When the conversation is reestablished, the DDEML attempts to reestablish any preexisting advise loops.
DdeSetUserHandle Associates an application-defined value with a conversation handle or a transaction identifier. This is useful for simplifying the processing of asynchronous transactions. An application can use the DdeQueryConvInfo function to retrieve this value.
DdeUnaccessData Unaccesses a DDE object. An application must call this function after it has finished accessing the object.
DdeUninitialize Frees all DDEML resources associated with the calling application.

DDEML Transactions

Name Description
XTYP_ADVDATA Informs the client that the value of the data item has changed. The DDE client callback function, DdeCallback, receives this transaction after establishing an advise loop with a server.
XTYP_ADVREQ Informs the server that an advise transaction is outstanding on the specified topic name and item name pair and that data corresponding to the topic name and item name pair has changed. The system sends this transaction to the DDE callback function, DdeCallback, after the server calls the DdePostAdvise function.
XTYP_ADVSTART A client uses the XTYP_ADVSTART transaction to establish an advise loop with a server. A DDE server callback function, DdeCallback, receives this transaction when a client specifies XTYP_ADVSTART as the wType parameter of the DdeClientTransaction function.
XTYP_ADVSTOP A client uses the XTYP_ADVSTOP transaction to end an advise loop with a server. A DDE server callback function, DdeCallback, receives this transaction when a client specifies XTYP_ADVSTOP in the DdeClientTransaction function.
XTYP_CONNECT A client uses the XTYP_CONNECT transaction to establish a conversation. A DDE server callback function, DdeCallback, receives this transaction when a client specifies a service name that the server supports (and a topic name that is not NULL) in a call to the DdeConnect function.
XTYP_CONNECT_CONFIRM A DDE server callback function, DdeCallback, receives the XTYP_CONNECT_CONFIRM transaction to confirm that a conversation has been established with a client and to provide the server with the conversation handle. The system sends this transaction as a result of a previous XTYP_CONNECT or XTYP_WILDCONNECT transaction.
XTYP_DISCONNECT An application's DDE callback function, DdeCallback, receives the XTYP_DISCONNECT transaction when the application's partner in a conversation uses the DdeDisconnect function to terminate the conversation.
XTYP_ERROR A DDE callback function, DdeCallback, receives the XTYP_ERROR transaction when a critical error occurs.
XTYP_EXECUTE A client uses the XTYP_EXECUTE transaction to send a command string to the server. A DDE server callback function, DdeCallback, receives this transaction when a client specifies XTYP_EXECUTE in the DdeClientTransaction function.
XTYP_MONITOR A DDE debugger's DDE callback function, DdeCallback, receives the XTYP_MONITOR transaction whenever a DDE event occurs in the system. To receive this transaction, an application must specify the APPCLASS_MONITOR value when it calls the DdeInitialize function.
XTYP_POKE A client uses the XTYP_POKE transaction to send unsolicited data to the server. A DDE server callback function, DdeCallback, receives this transaction when a client specifies XTYP_POKE in the DdeClientTransaction function.
XTYP_REGISTER A DDE callback function, DdeCallback, receives the XTYP_REGISTER transaction type whenever a DDEML server application uses the DdeNameService function to register a service name, or whenever a non-DDEML application that supports the System topic is started.
XTYP_REQUEST A client uses the XTYP_REQUEST transaction to request data from a server. A DDE server callback function, DdeCallback, receives this transaction when a client specifies XTYP_REQUEST in the DdeClientTransaction function.
XTYP_UNREGISTER A DDE callback function, DdeCallback, receives the XTYP_UNREGISTER transaction whenever a DDEML server application uses the DdeNameService function to unregister a service name, or whenever a non-DDEML application that supports the System topic is terminated.
XTYP_WILDCONNECT The XTYP_WILDCONNECT transaction allows a client to establish a conversation on each of the server's service name and topic name pairs that match the specified service name and topic name. A DDE server callback function, DdeCallback, receives this transaction when a client specifies a NULL service name, a NULL topic name, or both in a call to the DdeConnect or DdeConnectList function.
XTYP_XACT_COMPLETE A DDE client callback function, DdeCallback, receives the XTYP_XACT_COMPLETE transaction when an asynchronous transaction, initiated by a call to the DdeClientTransaction function, has completed.

DDEML Structures

Name Description
CONVCONTEXT Contains information supplied by a DDE client application. The information is useful for specialized or cross-language DDE conversations.
CONVINFO Contains information about a DDE conversation.
DDEML_MSG_HOOK_DATA Contains information about a DDE message, and provides read access to the data referenced by the message. This structure is intended to be used by a DDEML monitoring application.
MONCBSTRUCT Contains information about the current DDE transaction. A DDE debugging application can use this structure when monitoring transactions that the system passes to the DDE callback functions of other applications.
MONCONVSTRUCT Contains information about a DDE conversation. A DDE monitoring application can use this structure to obtain information about a conversation that has been established or has terminated.
MONERRSTRUCT Contains information about the current DDE error. A DDE monitoring application can use this structure to monitor errors returned by DDE Management Library functions.
MONHSZSTRUCT Contains information about a DDE string handle. A DDE monitoring application can use this structure when monitoring the activity of the string manager component of the DDE Management Library.
MONLINKSTRUCT Contains information about a DDE advise loop. A DDE monitoring application can use this structure to obtain information about an advise loop that has started or ended.
MONMSGSTRUCT Contains information about a DDE message. A DDE monitoring application can use this structure to obtain information about a DDE message that was sent or posted.