GetHGlobalFromILockBytes
Retrieves a
global memory handle to a byte array object created using the CreateILockBytesOnHGlobal
WINOLEAPI GetHGlobalFromILockBytes(
ILockBytes * pLkbyt, |
//Points
to the byte array object |
HGLOBAL * phglobal |
//Points
to the current memory handle for the specified byte array |
); |
|
Parameters
pLkbyt
[in] Points
to the ILockBytes interface on the byte array object previously created
by a call to the CreateILockBytesOnHGlobal
phglobal
[out] Points
to the current memory handle used by the specified byte array object.
Return Values
S_OK
Indicates the
handle was returned successfully.
E_INVALIDARG
Indicates
invalid value specified for the pLkbyt parameter. It can also indicate
that the byte array object passed in is not one created by the CreateILockBytesOnHGlobal
Comments
After a call
to CreateILockBytesOnHGlobal
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
This function
only works within the same process from which the byte array was created.
See Also