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. unhandeld exception

unhandeld exception

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelpc++visual-studioquestion
2 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
    lalue
    wrote on last edited by
    #1

    Hi there, i have a really annoying problem with exceptions. On my system (Windows 2000, VS 6, SP3) the following code produces an unhandeld C++ exception: class TEST { public: TEST() {}; }; try { TRACE("before throw TEST\n"); throw TEST(); } catch (TEST x) { TRACE ("test catched\n"); } catch (...) { TRACE ("unkown catched\n"); } TRACE("after throw TEST\n"); The debug window shows the following: >before throw TEST >test catched >after throw TEST >Nicht abgefangene Ausnahme in TESTEXCEP.exe (KERNEL32.DLL): 0xE06D7363: >Microsoft C++ Exception. What's going wrong? Any help is welcome. Thanx Klaus

    P 1 Reply Last reply
    0
    • L lalue

      Hi there, i have a really annoying problem with exceptions. On my system (Windows 2000, VS 6, SP3) the following code produces an unhandeld C++ exception: class TEST { public: TEST() {}; }; try { TRACE("before throw TEST\n"); throw TEST(); } catch (TEST x) { TRACE ("test catched\n"); } catch (...) { TRACE ("unkown catched\n"); } TRACE("after throw TEST\n"); The debug window shows the following: >before throw TEST >test catched >after throw TEST >Nicht abgefangene Ausnahme in TESTEXCEP.exe (KERNEL32.DLL): 0xE06D7363: >Microsoft C++ Exception. What's going wrong? Any help is welcome. Thanx Klaus

      P Offline
      P Offline
      Paul Selormey
      wrote on last edited by
      #2

      Hello Klaus, What do you really expect of the program? To me, not an expert in exceptions anyway, it is the normal flow. Probably you may gain some confidence from the ff. MS own codes under the topic "C++ Exception Examples"... Check the MSDN for the expected results and see how this is different or similar to yours. Again, I am not an expert, so take this as my humble piece!!! #include void MyFunc( void ); class CTest { public: CTest(){}; ~CTest(){}; const char *ShowReason() const { return "Exception in CTest class."; } }; class CDtorDemo { public: CDtorDemo(); ~CDtorDemo(); }; CDtorDemo::CDtorDemo() { cout << "Constructing CDtorDemo." << endl; } CDtorDemo::~CDtorDemo() { cout << "Destructing CDtorDemo." << endl; } void MyFunc() { CDtorDemo D; cout<< "In MyFunc(). Throwing CTest exception." << endl; throw CTest(); } int main() { cout << "In main." << endl; try { cout << "In try block, calling MyFunc()." << endl; MyFunc(); } catch( CTest E ) { cout << "In catch handler." << endl; cout << "Caught CTest exception type: "; cout << E.ShowReason() << endl; } catch( char *str ) { cout << "Caught some other exception: " << str << endl; } cout << "Back in main. Execution resumes here." << endl; return 0; }

      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