DdeEnableCallback function (ddeml.h)

Enables or disables transactions for a specific conversation or for all conversations currently established by the calling application.

Syntax

BOOL DdeEnableCallback(
  [in] DWORD idInst,
  [in] HCONV hConv,
  [in] UINT  wCmd
);

Parameters

[in] idInst

Type: DWORD

The application-instance identifier obtained by a previous call to the DdeInitialize function.

[in] hConv

Type: HCONV

A handle to the conversation to enable or disable. If this parameter is NULL, the function affects all conversations.

[in] wCmd

Type: UINT

The function code. This parameter can be one of the following values.

Value Meaning
EC_ENABLEALL
0
Enables all transactions for the specified conversation.
EC_ENABLEONE
0x0080
Enables one transaction for the specified conversation.
EC_DISABLE
0x0008
Disables all blockable transactions for the specified conversation.

A server application can disable the following transactions:

A client application can disable the following transactions:
EC_QUERYWAITING
2
Determines whether any transactions are in the queue for the specified conversation.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

If the wCmd parameter is EC_QUERYWAITING, and the application transaction queue contains one or more unprocessed transactions that are not being processed, the return value is TRUE; otherwise, it is FALSE.

The DdeGetLastError function can be used to get the error code, which can be one of the following values:

Remarks

An application can disable transactions for a specific conversation by returning the CBR_BLOCK return code from its Dynamic Data Exchange (DDE) callback function. When you reenable the conversation by using the DdeEnableCallback function, the operating system generates the same transaction that was in process when the conversation was disabled.

Using the EC_QUERYWAITING flag does not change the enable state of the conversation and does not cause transactions to be issued within the context of the call to DdeEnableCallback.

If DdeEnableCallback is called with EC_QUERYWAITING and the function returns a nonzero, an application should try to quickly allow message processing, return from its callback, or enable callbacks. Such a result does not guarantee that subsequent callbacks will be made. Calling DdeEnableCallback with EC_QUERYWAITING lets an application with blocked callbacks determine whether there are any transactions pending on the blocked conversation. Of course, even if such a call returns zero, an application should always process messages in a timely manner.

Requirements

Requirement Value
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)
Library User32.lib
DLL User32.dll

See also

Conceptual

DdeConnect

DdeConnectList

DdeDisconnect

DdeInitialize

Dynamic Data Exchange Management Library

Reference