PDA

View Full Version : LoadImage failing



MrT
07-10-2002, 09:08 AM
Hi,

Loading certain bitmap files is failing on me. The command:

HBITMAP hBmp = (HBITMAP) ::LoadImage (NULL, (LPCTSTR) fileName, IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE | LR_CREATEDIBSECTION);

Is returning NULL, (but only for certain bitmaps). Can I use DevIL to get around this and save some work in my loading of textures that will avoid this problem?

Thanks

Deiussum
07-10-2002, 10:13 AM
I haven't used Devil, but I'm guessing that would work for you.

So far as your problem, have you tried to use GetLastError to find the error code when LoadImage returns NULL? That would be useful for telling you exactly why it is failing.

MrT
07-10-2002, 11:34 AM
Thanks for the reply...

Using GetLastError() with FormatMessage, I am told :

"The operation completed successfully"

which is strange since hBmp = NULL

Do you know what it might be?