Click here to Skip to main content
15,794,236 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to catch exception before a crash happens? Pin
Randor 21-Oct-09 21:57
professional Randor 21-Oct-09 21:57 
GeneralOT Pin
Rajesh R Subramanian21-Oct-09 21:59
professionalRajesh R Subramanian21-Oct-09 21:59 
GeneralRe: OT Pin
Randor 21-Oct-09 22:06
professional Randor 21-Oct-09 22:06 
GeneralRe: OT-2 Pin
CPallini21-Oct-09 22:10
mveCPallini21-Oct-09 22:10 
JokeRe: OT-2 Pin
Rajesh R Subramanian22-Oct-09 8:39
professionalRajesh R Subramanian22-Oct-09 8:39 
GeneralRe: OT-2 Pin
CPallini22-Oct-09 10:26
mveCPallini22-Oct-09 10:26 
AnswerRe: How to catch exception before a crash happens? Pin
Naveen21-Oct-09 21:59
Naveen21-Oct-09 21:59 
QuestionRe: How to catch exception before a crash happens? Pin
jtasph21-Oct-09 22:26
jtasph21-Oct-09 22:26 
Naveen wrote:
However I suspect the necessity of supressing the CRT exception trough the above method. I guess the you can use the _set_abort_behavior() to control the exception handler of CRT.


I found out some introdution about exception handling mechanism in VS2005.
There're 3 kinds of checks in CRT code that pass around and invoke Dr.Watson directly. 
1.One is when we have detected a buffer overrun (/GS failure). For security reasons in this case, we directly call the UnhandledExceptionFilter. 
2.Another is when we detect an invalid parameter before a bad situation occurs. 
3.A third are other abnormal terminations (purecall, unexpected, etc). These generally have their own handlers that you can set (_set_purecall, _set_terminate, _set_unexpected). These exist only in cases where we consider it safe to do so. 

_set_abort_behavior, signal(SIGABRT, ...), and _set_invalid_parameter_handler(...) functions allow to intercept in case 2 and case 3. But for case 1, we can set api hook.  


Is it right?
AnswerRe: How to catch exception before a crash happens? Pin
Naveen21-Oct-09 22:53
Naveen21-Oct-09 22:53 
AnswerRe: How to catch exception before a crash happens? Pin
Randor 21-Oct-09 23:10
professional Randor 21-Oct-09 23:10 
GeneralRe: How to catch exception before a crash happens? Pin
jtasph21-Oct-09 23:18
jtasph21-Oct-09 23:18 
QuestionRe: How to catch exception before a crash happens? [modified] Pin
jtasph22-Oct-09 0:16
jtasph22-Oct-09 0:16 
QuestionNeed help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 20:23
Nicholas Amh21-Oct-09 20:23 
AnswerRe: Need help for CStdioFile Read mode Pin
Adam Roderick J21-Oct-09 20:38
Adam Roderick J21-Oct-09 20:38 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 20:47
Nicholas Amh21-Oct-09 20:47 
GeneralRe: Need help for CStdioFile Read mode [modified] Pin
Adam Roderick J21-Oct-09 20:54
Adam Roderick J21-Oct-09 20:54 
AnswerRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 20:38
Naveen21-Oct-09 20:38 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:11
Nicholas Amh21-Oct-09 21:11 
GeneralRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 21:24
Naveen21-Oct-09 21:24 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 22:48
Nicholas Amh21-Oct-09 22:48 
GeneralRe: Need help for CStdioFile Read mode Pin
Richard MacCutchan22-Oct-09 0:18
mveRichard MacCutchan22-Oct-09 0:18 
AnswerRe: Need help for CStdioFile Read mode Pin
theCPkid21-Oct-09 20:42
theCPkid21-Oct-09 20:42 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:24
Nicholas Amh21-Oct-09 21:24 
GeneralRe: Need help for CStdioFile Read mode Pin
theCPkid22-Oct-09 1:22
theCPkid22-Oct-09 1:22 
QuestionRe: Need help for CStdioFile Read mode Pin
David Crow22-Oct-09 4:25
David Crow22-Oct-09 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.