Creates a new picture object and initializes it from the contents of a stream. This is equivalent to calling OleCreatePictureIndirect(NULL, ...) followed by IPersistStream::Load.
IStream * pStream,
//Pointer to the stream that contains picture's data
LONG lSize, //Number of bytes read from the stream
//The opposite of the initial value of the picture's
REFIID riid, //Reference to the identifier of the interface
// describing the type of interface pointer to return
VOID ppvObj //Address of output variable that receives interface
// pointer requested in riid
[in] Pointer to the stream that contains the picture's data.
[in] Number of bytes that should be read from the stream, or zero if the entire stream should be read.
[in] The opposite of the initial value of the KeepOriginalFormat property. If TRUE, KeepOriginalFormat is set to FALSE and vice-versa.
[in] Reference to the identifier of the interface describing the type of interface pointer to return in ppvObj.
[out] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObj contains the requested interface pointer on the storage of the object identified by the moniker. If *ppvObj is non-NULL, this function calls IUnknown::AddRef on the interface; it is the caller's responsibility to call IUnknown::Release. If an error occurs, *ppvObj is set to NULL.
This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
The picture was created successfully.
The address in pStream or ppvObj is not valid. For example, either may be NULL.
The object does not support the interface specified in riid.
The stream must be in BMP (bitmap), WMF (metafile), or ICO (icon) format. A picture object created using OleLoadPicture always has ownership of its internal resources (fOwn==TRUE is implied).
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in olectl.h.
Import Library: Included as a resource in olepro32.dll.