Platform SDK: Memory |
The LocalHandle function retrieves the handle associated with the specified pointer to a local memory object.
Note The local functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions.
HLOCAL LocalHandle( LPCVOID pMem // pointer to local memory object );
If the function succeeds, the return value is a handle to the specified local memory object.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
When the LocalAlloc function allocates a local memory object with LMEM_MOVEABLE, it returns a handle to the object. The LocalLock function converts this handle into a pointer to the object's memory block, and LocalHandle converts the pointer back into a handle.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Memory Management Overview, Memory Management Functions, LocalAlloc, LocalLock