GetHGlobalFromStream (Windows CE 5.0)

Send Feedback

This function retrieves the global memory handle to a stream that was created through a call to the CreateStreamOnHGlobal function.

WINOLEAPI GetHGlobalFromStream(IStream* pstm,HGLOBAL* phglobal);

Parameters

  • pstm
    [in] IStream pointer to the stream object created by a call to the CreateStreamOnHGlobal function.
  • phglobal
    [out] Pointer to the current memory handle used by the specified stream object.

Return Values

The following HRESULT values can be returned.

Value Description
S_OK Indicates that the handle was returned.
E_INVALIDARG Indicates an invalid value specified for the pstm parameter.

It can also indicate that the stream object passed in is not one created by a call to the CreateStreamOnHGlobal function.

Remarks

The handle this function returns can differ from the original handle due to intervening LocalRealloc calls.

This function can be called only from within the same process that the byte array was created from.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Ole2.h.
Link Library: Ole32.lib.

See Also

Automation Functions | CreateStreamOnHGlobal | IStream | LocalRealloc | Determining Supported COM APIs

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.