DdeEnableCallback

3.1

  #include <ddeml.h>    

  BOOL DdeEnableCallback(idInst, hConv, uCmd)    
  DWORD idInst; /* instance identifier, */  
  HCONV hConv; /* handle of conversation, */  
  UINT uCmd; /* the enable/disable function code */

The DdeEnableCallback function enables or disables transactions for a specific conversation or for all conversations that the calling application currently has established.

After disabling transactions for a conversation, the system places the transactions for that conversation in a transaction queue associated with the application. The application should reenable the conversation as soon as possible to avoid losing queued transactions.

Parameters

idInst

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

hConv

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

uCmd

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

Value Meaning

EC_ENABLEALL Enables all transactions for the specified conversation.
EC_ENABLEONE Enables one transaction for the specified conversation.
EC_DISABLE Disables all blockable transactions for the specified conversation.
  A server application can disable the following transactions:
  XTYP_ADVSTART XTYP_ADVSTOP XTYP_EXECUTE XTYP_POKE XTYP_REQUEST
  A client application can disable the following transactions:
  XTYP_ADVDATA XTYP_XACT_COMPLETE

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Errors

Use the DdeGetLastError function to retrieve the error value, which may be one of the following:

DMLERR_DLL_NOT_INITIALIZED
DMLERR_NO_ERROR
DMLERR_INVALIDPARAMETER

Comments

An application can disable transactions for a specific conversation by returning CBR_BLOCK from its dynamic data exchange (DDE) callback function. When the conversation is reenabled by using the DdeEnableCallback function, the system generates the same transaction as was in process when the conversation was disabled.

See Also

DdeConnect, DdeConnectList, DdeDisconnect, DdeInitialize