CResourceException
-
I posted this question a few days ago here but I never got a response so I'll try again. I have a program I wrote, it's more or less done. The problem is after I run it through VS, my program slows down considerably and I click stop and I get a lot of the messages:
First-chance exception at 0x7c81eb33 in myprogram.exe: Microsoft C++ exception: CResourceException @ 0x0012f660. Warning: Uncaught exception in WindowProc (returning 0).
I know how to handle exceptions but the code is too distributed to know what is causing the problem. Is there a way to figure out those addresses that's causing the exceptions so I can deal with them?
-
I posted this question a few days ago here but I never got a response so I'll try again. I have a program I wrote, it's more or less done. The problem is after I run it through VS, my program slows down considerably and I click stop and I get a lot of the messages:
First-chance exception at 0x7c81eb33 in myprogram.exe: Microsoft C++ exception: CResourceException @ 0x0012f660. Warning: Uncaught exception in WindowProc (returning 0).
I know how to handle exceptions but the code is too distributed to know what is causing the problem. Is there a way to figure out those addresses that's causing the exceptions so I can deal with them?
From MSDN: A CResourceException object is generated when Windows cannot find or allocate a requested resource. No further qualification is necessary or possible. It could be the the resource id for one of the resources is wrong. Check that all valid resource ids in resource.h have a corresponding resource in the .rc file. I remember a while back I had a similar problem where my program would die on Windows 9x. It was because somehow the resource id ranges got messed up which were not valid for 9x machine ie. it was out of range. Once I corrected that it was all working fine.
-
From MSDN: A CResourceException object is generated when Windows cannot find or allocate a requested resource. No further qualification is necessary or possible. It could be the the resource id for one of the resources is wrong. Check that all valid resource ids in resource.h have a corresponding resource in the .rc file. I remember a while back I had a similar problem where my program would die on Windows 9x. It was because somehow the resource id ranges got messed up which were not valid for 9x machine ie. it was out of range. Once I corrected that it was all working fine.
Well, the resources are not really changed from what the ClassWizard so I don't think it's from that kind of mismatch. I only added 3 menu items and some dialog boxes to my project. The work that occurs is almost completely pure mathematical work plus periodic GDI drawing. I'll take a look at the OnPaint function and try to catch the exception there.
-
From MSDN: A CResourceException object is generated when Windows cannot find or allocate a requested resource. No further qualification is necessary or possible. It could be the the resource id for one of the resources is wrong. Check that all valid resource ids in resource.h have a corresponding resource in the .rc file. I remember a while back I had a similar problem where my program would die on Windows 9x. It was because somehow the resource id ranges got messed up which were not valid for 9x machine ie. it was out of range. Once I corrected that it was all working fine.
I did put a try block around each of 3 sections I have and the exception was caught. The exception gave the reason "A required resource was unavailable." I think the resource is tied to the drawing context instance in the function I'll have to investigate it further. I may have to put my OnPaint function in a critical section and use a single (binary) lock to control the flow. Also, if anyone wants to reply to add in regards to synchronization, I only have one UI thread doing work but it's calling back to the child view to tell it to redraw specific places.