Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


image loading problem

This topic is 5966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

// 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;

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!