LoadImage failing

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

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.

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?