DdeCallback

3.1

  #include <ddeml.h>    

  HDDEDATA CALLBACK DdeCallback(type, fmt, hconv, hsz1, hsz2, hData, dwData1, dwData2)    
  UINT type; /* transaction type, */  
  UINT fmt; /* clipboard data format, */  
  HCONV hconv; /* handle of conversation, */  
  HSZ hsz1; /* handle of string, */  
  HSZ hsz2; /* handle of string, */  
  HDDEDATA hData; /* handle of global memory object */
  DWORD dwData1; /* transaction-specific data */
  DWORD dwData2; /* transaction-specific data */

The DdeCallback function is an application-defined dynamic data exchange (DDE) callback function that processes DDE transactions sent to the function as a result of DDE Management Library (DDEML) calls by other applications.

Parameters

type

Specifies the type of the current transaction. This parameter consists of a combination of transaction-class flags and transaction-type flags. The following table describes each of the transaction classes and provides a list of the transaction types in each class. For information about a specific transaction type, see the individual description of that type in the Microsoft Windows Programmer's Reference, Volume 3.

Value Meaning

XCLASS_BOOL A DDE callback function should return TRUE or FALSE when it finishes processing a transaction that belongs to this class. Following are the XCLASS_BOOL transaction types:
  XTYP_ADVSTART XTYP_CONNECT
XCLASS_DATA A DDE callback function should return a DDE data handle, CBR_BLOCK, or NULL when it finishes processing a transaction that belongs to this class. Following are the XCLASS_DATA transaction types:
  XTYP_ADVREQ XTYP_REQUEST XTYP_WILDCONNECT
XCLASS_FLAGS A DDE callback function should return DDE_FACK, DDE_FBUSY, or DDE_FNOTPROCESSED when it finishes processing a transaction that belongs to this class. Following are the XCLASS_FLAGS transaction types:
  XTYP_ADVDATA XTYP_EXECUTE XTYP_POKE
XCLASS_NOTIFICATION The transaction types that belong to this class are for notification purposes only. The return value from the callback function is ignored. Following are the XCLASS_NOTIFICATION transaction types:
  XTYP_ADVSTOP XTYP_CONNECT_CONFIRM XTYP_DISCONNECT XTYP_ERROR XTYP_MONITOR XTYP_REGISTER XTYP_XACT_COMPLETE XTYP_UNREGISTER

fmt

Specifies the format in which data is to be sent or received.

hconv

Identifies the conversation associated with the current transaction.

hsz1

Identifies a string. The meaning of this parameter depends on the type of the current transaction. For more information, see the description of the transaction type.

hsz2

Identifies a string. The meaning of this parameter depends on the type of the current transaction. For more information, see the description of the transaction type.

hData

Identifies DDE data. The meaning of this parameter depends on the type of the current transaction. For more information, see the description of the transaction type.

dwData1

Specifies transaction-specific data. For more information, see the description of the transaction type.

dwData2

Specifies transaction-specific data. For more information, see the description of the transaction type.

Return Value

The return value depends on the transaction class. For more information about
return values, see the descriptions of the individual DDE transactions in the
Microsoft Windows Programmer's Reference
, Volume 3.

Comments

The callback function is called asynchronously for transactions that do not involve creating or terminating conversations. An application that does not frequently accept incoming messages will have reduced DDE performance because DDEML uses messages to initiate transactions.

An application must register the callback function by specifying its address in a call to the DdeInitialize function. DdeCallback is a placeholder for the application- or library-defined function name. The actual name must be exported by including it in an EXPORTS statement in the application's module-definition file.

See Also

DdeEnableCallback, DdeInitialize