#include <ddeml.h> |
BOOL DdeKeepStringHandle(idInst, hsz) | ||||
DWORD idInst; | /* instance identifier, */ | |||
HSZ hsz; | /* handle of string, */ |
The DdeKeepStringHandle function increments the usage count (increases it by one) associated with the given handle. This function makes it possible for an application to save a string handle that was passed to the application's dynamic data exchange (DDE) callback function. Otherwise, a string handle passed to the callback function is deleted when the callback function returns.
idInst
Specifies the application-instance identifier obtained by a previous call to the DdeInitialize function.
hsz
Identifies the string handle to be saved.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The following example is a portion of a DDE callback function that increases the usage count and saves a local copy of two string handles:
HSZ hsz1;
HSZ hsz2;
static HSZ hszServerBase;
static HSZ hszServerInst;
DWORD idInst;
case XTYP_REGISTER:
/* Keep the handles for later use. */
DdeKeepStringHandle(idInst, hsz1);
DdeKeepStringHandle(idInst, hsz2);
hszServerBase = hsz1;
hszServerInst = hsz2;
.
. /* Finish processing the transaction. */
.
DdeCreateStringHandle, DdeFreeStringHandle, DdeInitialize, DdeQueryString