This is my code so far for trying to load a few bitmaps into my program, although at the moment, it's not going well, lol. For some reason, the function calls to LoadBitmap are constantly failing, and I can't find where the problem is.
In my main.cpp file:
Code:
case WM_CREATE:
// Create handles for the bitmaps. These will be used in the Button replace function
hbmCross = LoadBitmap(hThisInstance, "ID_BMP_CROSS");
hbmNaught = LoadBitmap(hThisInstance, "ID_BMP_NAUGHT");
if(!hbmCross || !hbmNaught) {
sprintf(Info.buffer, "Could not load resources from file");
MessageBox(hwnd, Info.buffer, "Error Loading Resources", MB_ICONERROR);
SendMessage(hwnd, WM_DESTROY, 0, 0);
return -1;
}
The important line is the LoadBitmap function calls, since these are the one(s) which are always failing.
included in my images.rc file:
Code:
/* images.rc which contains the IDs for the image files used */
ID_BMP_CROSS BITMAP "cross.bmp"
ID_BMP_NAUGHT BITMAP "naught.bmp"
I've added my images.rc file to the project. At first, I thought that the problem was different names used in the program, from the names of the files in the directory, but that's still not working. I'm out of ideas as to what the problem might be.
[edit]I've also tried using MAKEINTRESOURCE, but that didn't work either[/edit]