Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CResourceException

CResourceException

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++cssvisual-studiocom
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LighthouseJ
    wrote on last edited by
    #1

    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?

    A 1 Reply Last reply
    0
    • L LighthouseJ

      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?

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      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.

      L 2 Replies Last reply
      0
      • A Anonymous

        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.

        L Offline
        L Offline
        LighthouseJ
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • A Anonymous

          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.

          L Offline
          L Offline
          LighthouseJ
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups