Retrieves a global memory handle to a byte array object created using the CreateILockBytesOnHGlobal function.
WINOLEAPI GetHGlobalFromILockBytes(
ILockBytes * pLkbyt, //Points to the byte array object
HGLOBAL * phglobal //Points to the current memory handle for
// the specified byte array
);
After a call to CreateILockBytesOnHGlobal, which creates a byte array object on global memory, GetHGlobalFromILockBytes retrieves a pointer to the handle of the global memory underlying the byte array object. The handle this function returns might be different from the original handle due to intervening calls to the GlobalRealloc function.
The contents of the returned memory handle can be written to a clean disk file, and then opened as a storage object using the StgOpenStorage function.
This function only works within the same process from which the byte array was created.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ole2.h.
Import Library: Included as a resource in ole32.dll.
StgOpenStorage, CreateILockBytesOnHGlobal