Resources in Windows

Started by
1 comment, last by Roger Hill 24 years, 1 month ago
Hello, I''m having a devil of a time using resources in Windows. I build a win32 app that registers a normal window, draws it, and goes into the famous message loop. I can have it read ''resources'' such as .bmps and such from the same directory just fine, but when I include the .bmps in the project (vc++5.0), I can''t get windows to ''find'' the embedded/included .bmp. I''ve made sure to include the Script.rc, the resource.h, and the .bmp file in the project. I''ve checked to make sure that the .bmp has a ''macro'', IDB_BITMAP1, and the resource.h file has been #included in the main.cpp file. I''ve been using LoadImmage(), LoadIcon(), LoadCursor(), etc, and none of them seem to work. The project will compile w/o errors, but only default resources will be displayed.(That is, the standard cursor, the lowest nmbered icon will be displayed as the application icon, etc.) Any suggestions? I''m out of ideas, and I can''t find any useful examples in the VC++5.0 help files... Thanks in advance.
R.HillTigger@Bung.Org"Wasting Bandwidth since 1980"
Advertisement

It could be that the params to the LoadXXX are incorrect.

Or, it could be that you aren''t selecting the GDI object into a valid device context after you have loaded it.

e.g.

HANDLE image = LoadImage(...);

SelectObject(hdc, image);


HTH,

-mordell
__________________________________________

Yeah, sure... we are laughing WITH you ...
You should load the resources like this

HBITMAP = LoadImage(hInst, MAKEINTRESOURCE(IDB_BITMAP1));

Where hInst is the Instance variable that you receive in WinMain().

This topic is closed to new replies.

Advertisement