#include <ddeml.h> |
BOOL DdeUnaccessData(hData) | |||||
HDDEDATA hData; | /* handle of global memory object | */ |
The DdeUnaccessData function frees a global memory object. An application must call this function when it is finished accessing the object.
hData
Identifies the global memory object.
The return value is nonzero if the function is successful. Otherwise, it is zero.
Use the DdeGetLastError function to retrieve the error value, which may be one of the following:
DMLERR_DLL_NOT_INITIALIZED
DMLERR_INVALIDPARAMETER
DMLERR_NO_ERROR
The following example obtains a pointer to a global memory object, uses the pointer to copy data from the object to a local buffer, and then uses the DdeUnaccessData function to free the object:
HDDEDATA hData;
LPBYTE lpszAdviseData;
DWORD cbDataLen;
DWORD i;
char szData[128];
lpszAdviseData = DdeAccessData(hData, &cbDataLen);
for (i = 0; i < cbDataLen; i++)
szData[i] = *lpszAdviseData++;
DdeUnaccessData(hData);
DdeAccessData, DdeAddData, DdeCreateDataHandle, DdeFreeDataHandle