Re: Unhandled exception - How to turn off!
- From: "Ben Voigt" <rbv@xxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 15:51:58 -0500
"David F." <df2705@xxxxxxxxxxxxxxxx> wrote in message
news:u57jE5yaHHA.1244@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I don't use exception handling and things like failed memory allocations
(new()) failures are expected and handled internally. I tried setting the
VS2005 ide setting for C++ Exception Handling to No yet when new() fails
it throws up a screen about a run-time error. If running in the VS2005
environment, you get
"Unhandled exception at 0x12345 in progname.exe: Microsoft C++ exception:
std::bad_alloc at memory location 0x121345"
Continue or Break. I can continue and continue and the program runs fine.
So how to I turn off all Exception Handling so it's not used at all???
You want new to return NULL in case of failure instead of throwing? You're
now (since C++03 I think) supposed to do:
new (std::nothrow) T[N];
to get that functionality.
There are some tricks you can do to get that behavior process-wide without
editing every line of code, but you have to ask whether you want to have
code that's unmaintainable because it doesn't follow the standard.
If you decide putting std::nothrow on each allocation is too much effort,
post again and we'll see about activating the old behavior.
(Ah - Maybe I have to recompile the entire library which is just about
impossible to move back to the old version at this point).
So let me ask this then, how do I setup some generic exception handler in
the main module that just returns so the program continues normally?
TIA!!
.
- Follow-Ups:
- Re: Unhandled exception - How to turn off!
- From: Ulrich Eckhardt
- Re: Unhandled exception - How to turn off!
- From: David F.
- Re: Unhandled exception - How to turn off!
- References:
- Unhandled exception - How to turn off!
- From: David F.
- Unhandled exception - How to turn off!
- Prev by Date: Unhandled exception - How to turn off!
- Next by Date: A simple problem with an abstract class...
- Previous by thread: Unhandled exception - How to turn off!
- Next by thread: Re: Unhandled exception - How to turn off!
- Index(es):
Relevant Pages
|