Ok.. glad I could help.
Still want to make a few remarks though:
1. If on a PPC you will load from a resource with id=IDR_MENU from the resource group=IMAGE. And on the desktop you're trying to load a resource with id=IDB_MENU from the group=image. Remember that if you do not specify the gruop you will get the default which is:
Surface* LoadImage( DisplayDevice* display, unsigned resourceID, const TCHAR* resclass = _T("image"), HINSTANCE hModule = 0 );
Not sure if this has anything to do with it (I always use external resources, i.e. files) but it's worth a shot. Just look at the resource file (named something.rc) and see what group and id your BMP files actually got. My guess it that JPG's end up in group IMAGE and BMP end up in group BITMAP. This is the case for Blit.rc, the resource for the Blit sample.
2. Using PNG is not very clever. It might seem like a good idea since the PNG format is far superior to the other alternatives. But if you look closer to what actually happens when the PNG gets decoded you notice that it will be rendered as a normal bitmap. I.e. the alpha channel is simply discarded and hence you might as well use JPG format since then you could atleast use the same resources for both the PDA and the desktop.
3. I found that for using transparent images the best way would be to have it as a JPG resource using a designated transparecy color (I used black). Then simply call SetColorMask(0) to enable it (or the equivalent color). I never got the transparent GIF:s to work and besides: with JPG you get better quality.
4. You should always compare your surface to NULL (or 0) before dereferencing it calling a function. What I mean is that if you do something like:
- Code:
gMenu = LoadImage(gScreen, IDB_MENU);
if (gMenu)
gMenu->SetColorMask(0);
else
MessageBox("Unable to load image","DEBUG",MB_OK);
You will be able to take actions and exit gracefully (or possibly resolve the situation loading another resource instead). This naturally goes for all objects you create. Always validate them before you use them since otherwise you will be thrown out of your program with a segment fault.