Re: compile error about destructor
- From: Abhishek Padmanabh <abhishek.padmanabh@xxxxxxxxx>
- Date: Sat, 23 Feb 2008 06:18:11 -0800 (PST)
On Feb 23, 6:43 pm, George <Geo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Thanks Abhishek,
1.
The __except handler is incorrect. There are only 3 valid values for
it. If the result of the expression for __except is anything other
than those 3 values probably it gets blocked searching for an
appropriate value (or whatever as per msdn, I am not sure what blocks
the execution) and hence the execution hangs up. You should rephrase
that as below:
Why only 3 values? What are the 3 values do you mean?
From MSDN, there are more values for exception code, check for the "Return
Value" section,
http://msdn2.microsoft.com/en-us/library/ms679356.aspx
I was not saying about the GetExceptionCode() function. It can return
variety of different codes. But the expression inside the except()
should evaluate to one of the following 3 values:
1) EXCEPTION_CONTINUE_SEARCH
2) EXCEPTION_CONTINUE_EXECUTION
3) EXCEPTION_EXECUTE_HANDLER
Depending upon the above values, the decision is made as to what needs
to be done after the __except expression evaluation. Should it go to
the handler (*_HANDLER), should it skip the handler and continue
execution from after it suppressing/ignoring the exception
(*_EXECUTION) or keep looking for the next handler (similar to
rethrowing the exception or better say, not handling it at all)
(*_SEARCH).
Read up on try-except here - http://msdn2.microsoft.com/en-us/library/s58ftw19(VS.80).aspx
2.
__try
{
helper();
}
__except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER :
EXCEPTION_CONTINUE_EXECUTION)
{
cout << "access violation caught 2" << endl;
}
What is your purpose of put EXCEPTION_EXECUTE_HANDLER and
EXCEPTION_CONTINUE_EXECUTION? I do not understand the whole function of the
statemet,
__except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER :
EXCEPTION_CONTINUE_EXECUTION)
Some more descriptions are appreciated. :-)
See above.
.
- References:
- Re: compile error about destructor
- From: Ben Voigt [C++ MVP]
- Re: compile error about destructor
- From: Ben Voigt [C++ MVP]
- Re: compile error about destructor
- From: George
- Re: compile error about destructor
- From: Ben Voigt [C++ MVP]
- Re: compile error about destructor
- From: George
- Re: compile error about destructor
- From: Abhishek Padmanabh
- Re: compile error about destructor
- Prev by Date: Re: data breakpoint
- Next by Date: Re: compile error about auto_ptr
- Previous by thread: Re: compile error about destructor
- Next by thread: Re: compile error about destructor
- Index(es):
Relevant Pages
|