PFNCALLBACK callback function (ddeml.h)

An application-defined callback function used with the Dynamic Data Exchange Management Library (DDEML) functions. It processes Dynamic Data Exchange (DDE) transactions. The PFNCALLBACK type defines a pointer to this callback function. DdeCallback is a placeholder for the application-defined function name.

Syntax

PFNCALLBACK Pfncallback;

HDDEDATA Pfncallback(
  [in] UINT wType,
  [in] UINT wFmt,
  [in] HCONV hConv,
  [in] HSZ hsz1,
  [in] HSZ hsz2,
  [in] HDDEDATA hData,
  [in] ULONG_PTR dwData1,
  [in] ULONG_PTR dwData2
)
{...}

Parameters

[in] wType

Type: UINT

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 Remarks.

[in] wFmt

Type: UINT

The format in which data is sent or received.

[in] hConv

Type: HCONV

A handle to the conversation associated with the current transaction.

[in] hsz1

Type: HSZ

A handle to a string. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type in Remarks.

[in] hsz2

Type: HSZ

A handle to a string. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type in Remarks.

[in] hData

Type: HDDEDATA

A handle to DDE data. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type in Remarks.

[in] dwData1

Type: ULONG_PTR

Transaction-specific data. For the meaning of this parameter, see the description of the transaction type in Remarks.

[in] dwData2

Type: ULONG_PTR

Transaction-specific data. For the meaning of this parameter, see the description of the transaction type in Remarks.

Return value

Type: HDDEDATA

The return value depends on the transaction class. For more information about the return values, see descriptions of the individual transaction types.

Remarks

XCLASS_BOOL

A DDE callback function should return TRUE or FALSE when it finishes processing a transaction that belongs to this class. The XCLASS_BOOL transaction class consists of the following types:

XCLASS_DATA

A DDE callback function should return a DDE handle, the CBR_BLOCK return code, or NULL when it finishes processing a transaction that belongs to this class. The XCLASS_DATA transaction class consists of the following types:

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. The XCLASS_FLAGS transaction class consists of the following types:

XCLASS_NOTIFICATION

The transaction types that belong to this class are for notification purposes only. The return value from the callback function is ignored. The XCLASS_NOTIFICATION transaction class consists of the following types:

The callback function is called asynchronously for transactions that do not involve the creation or termination of conversations. An application that does not frequently accept incoming messages will have reduced DDE performance because the Dynamic Data Exchange Management Library (DDEML) uses messages to initiate transactions.

An application must register the callback function by specifying a pointer to the function in a call to the DdeInitialize function.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ddeml.h (include Windows.h)

See also

Conceptual

DdeEnableCallback

DdeInitialize

Dynamic Data Exchange Management Library