PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

FindResource problem

Very strange problem going on here, any ideas at all would be very much appreciated...

I have a file with some binary data that I need to get a pointer to. I've imported the file into my eVC++ project with a resoure type of "SCRIPTS".

When I try to do a FindResource on it as follows:

Code:

HRSRC hResInfo = NULL;
hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_SCENE_1), L"SCRIPTS");

I get back NULL every time. hInst is properly holding the app's handle and IDR_SCENE_1 is a defined resource symbol in resource.h (if I display it's value right before the FindResource call, it shows 126, which is what it is defined as in the header).

The worst part is, this works perfectly in the desktop emulator, but NOT on my real device (Casio E-125)! I do the exact same thing to load some other resources in other projects and it has always worked.

ANY ideas at all?? Thanks everyone!
Make sure you added the .rc file to your project.
fzammetti · 09 Dec 2002, 20:13 UTC — ARGH!!
Ok, feel free to fling rotten food in my direction, I most certainly deserve it...

The problem is that the module variable DID NOT have the proper value... it was never initialized, hence when I looked at it it LOOKED like it had a proper value, but I never did set it. AAARRRGGGHHH!!

I only found out by replacing it in my FindResource call with GetModuleHandle(NULL) which fixed my problem, I then pretty quickly realized what I'd done.

Ok, where is that thread I started a while back about stupid programmer tricks, this should be added!