Advertisement

catch( ... ) wont work

Started by August 03, 2000 02:25 AM
2 comments, last by IO Fission 24 years, 4 months ago
i got a try { blah; throw; blah; } catch( something ){blah;} then catch( ... ){ something that isnt a problem; } each time it ends up going to the catch( ... ) one the program chokes, showing me "The program blah blah has unexpectidly quit (NSS). Debug assertion failed" or something like that. Any ideas? Thanx "If you have any questions you may direct
them to that brick wall over there." - South Park
It would help you to find out where the assertion failure was. Basically, an assertion failure means that something wasn''t as it should have been, meaning a pointer that was supposed to hold a value could have been NULL, or if this is a Windows program, some UI element wasn''t valid, but it should have been.

If you''re using VC++, and using the debugger, then my advice would be to make sure you have the source to the Runtime Library on your hard drive (so you can step into it), or the MFC source, and press ''Debug'' on the assertion error dialog. The debugger will then go to the line of code that caused the problem, and you can use the call stack to step back through your code and see what the problem was.

This doesn''t sound like a problem with the catch block itself, but with the code that is in the catch block.

I hope this was clear enough... I''m really tired now
Advertisement
Correction:
"Runtime error! {FILENAME HERE} abnormal program termination"

Using MS VC++6.0 Std
Ive got code for catch( int &thing ) and catch( ... ), almost identical (just has different text), but it only ever stuffs up on the catch(...) . Blame MS?


"If you have any questions you may direct
them to that brick wall over there." - South Park
Always blame MS. That''s what most people here do.

After you''re done, though, make sure you''ve turned on exception handling in your project settings.
Project->Settings->C/C++ Tab->Category C++ Language->Enable Exception Handling.

This topic is closed to new replies.

Advertisement