image loading problem

Started by
1 comment, last by breakscience 22 years, 1 month ago
// load the BMP file m_hBitmap = (HBITMAP)LoadImage(NULL, MAKEINTRESOURCE(ResID),IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); Why doesn''t this work? ResID is an integer passed to a member function of my GDI Bitmap class. This seems like it should work, but I get an invalid param error code during runtime. I would appreciate any help, as I posted something similar before with no response. Thank you. Break;
Break;
Advertisement
When you load a resource, you need to to specify where to get it from. In this case, the HINSTANCE parameter is set to NULL. The function doesn''t know where to look to find the image. Instead, try setting the HINSTANCE to you''r applications instance, i.e.:
hBitmap = LoadImage(g_hInst, MAKEINTR...etc
That should work.
[source]#define JESUS 1[/source]
I wish I could try it, but Im at work. Thanks for your help, though.

Break;
Break;

This topic is closed to new replies.

Advertisement