In MSDN is written that this function can be used to load image from BMP, WMF, ICO and etc. Nothing is written about JPEG.
But something strange happens.
This is my code sequence.

1. FindResource, LoadResource, LockResource.
2. GlobalAlloc, GlobalLock.
3. memcpy, from the resource locked buffer to GlobalAlloc allocated, and GlobalLock locked buffer.
4. GlobalUnlock, UnlockResource, FreeResource.
5. CreateStreamOnHGlobal, OleLoadPicture.
and etc.

When I'm trying to load BMP from resource, an error occures in OleLoadPicture. But strangeness is in that everything goes OK with other file types, even JPEG.

What do I have to do to solve. Maybe anyones has faced that problem before. Please help.

Thanx for your attention...