VC++ 6.0
I can't seem to disable exception handling. I have a try / catch block and whenever I hit my exception control goes to my catch(...) handler.
I do not have /GX set. I am building using the IDE. (When I set /GX- in Project Settings the IDE just removes the switch...supposedly GX- is the default.)
Oh, and yes; as expected, when I compile with E.H. disabled I get a warning that my unwind semantics are not enabled.
My program should simply crash with E.H. turned off.
QUESTION: How do I get VC++ E.H. to really turn off
Thanks.
(Legitamate email, not spam, welcome at les.h.clark@baesystems.com.NoSpam w/o the 'NoSpam', of course)

Disabling Exception Handling
Rambo
Also the comment from Ismail is not quite correct. The correct statement of the rule is that you can't have C++ objects that require unwinding on the stack with-in a __try block.
class A {
};
class B {
public:
~B();
};
void f()
{
__try {
A a; // OK
B b; // Error
}
__except (1) {
}
}
RMcGill
If you have turned off your "C++ exception handling", do not use try-catch, you need __try/__except, and move those automatic objects into a function. See below:
class CMyClass
{
/* ... */
};
void SEHFriendlyCppFunction();
int foo()
{
__try
{
// CMyClass cls; // error - you can't have a C++ object on the stack when using SEH.
SEHFriendlyCppFunction();
}
__except(HandleWin32Exception())
{
}
__finally
{
}
}
void SEHFriendlyCppFunction()
{
CMyClass cls;
cls.Foo(); // hypothetically, this function can throw a Win32 exception...
} // stack unwinding happens here, not in SEH block.
Ismail
pgupta
Thanks Jonathan!
Will we be able to get (win32) exception information the way we normally do in __try/__except case
Ismail
goozbee