Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: OT-2 Pin
Rajesh R Subramanian22-Oct-09 7:39
professionalRajesh R Subramanian22-Oct-09 7:39 
GeneralRe: OT-2 Pin
CPallini22-Oct-09 9:26
mveCPallini22-Oct-09 9:26 
AnswerRe: How to catch exception before a crash happens? Pin
Naveen21-Oct-09 20:59
Naveen21-Oct-09 20:59 
QuestionRe: How to catch exception before a crash happens? Pin
jtasph21-Oct-09 21:26
jtasph21-Oct-09 21:26 
AnswerRe: How to catch exception before a crash happens? Pin
Naveen21-Oct-09 21:53
Naveen21-Oct-09 21:53 
AnswerRe: How to catch exception before a crash happens? Pin
Randor 21-Oct-09 22:10
professional Randor 21-Oct-09 22:10 
GeneralRe: How to catch exception before a crash happens? Pin
jtasph21-Oct-09 22:18
jtasph21-Oct-09 22:18 
QuestionRe: How to catch exception before a crash happens? [modified] Pin
jtasph21-Oct-09 23:16
jtasph21-Oct-09 23:16 
Thanks for all answerers. Here is my test code:
LONG WINAPI MyUnFilterA (struct _EXCEPTION_POINTERS *lpExceptionInfo)
{
    AfxMessageBox(_T("11"));
    return EXCEPTION_CONTINUE_SEARCH;
}

1.
void CExceptionDlg::OnBnClickedOk()
{
    SetUnhandledExceptionFilter(MyUnFilterA);
    DisableSetUnhandledExceptionFilter();
    *(int *) 0 = 0;
}
2.
void CExceptionDlg::OnBnClickedOk()
{
    SetUnhandledExceptionFilter(MyUnFilterA);
    DisableSetUnhandledExceptionFilter();
    abort();
}
3.
void CExceptionDlg::OnBnClickedOk()
{
    AddVectoredExceptionHandler(1, MyUnFilterA);
    *(int *) 0 = 0;
}
4.
void CExceptionDlg::OnBnClickedOk()
{
    AddVectoredExceptionHandler(1, MyUnFilterA);
    abort();
}


When I pressed button OK, an excepiton will occur. Case 1 and case 3 are the same result. That is,
MyUnFilterA will be be called and a messagebox will pop up and show the text "11". And after the messagebox is closed, the application exits. Case 2 and case 2 are the same result. An error dialog will pop up first and ask me "Abort", "Retry" or "Ignore". If select "Retry", the message box "11" will show. Otherwise, the application will exit.

I think it's better pop up my defined message box first. What should I do?

modified on Thursday, October 22, 2009 5:32 AM

QuestionNeed help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 19:23
Nicholas Amh21-Oct-09 19:23 
AnswerRe: Need help for CStdioFile Read mode Pin
Adam Roderick J21-Oct-09 19:38
Adam Roderick J21-Oct-09 19:38 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 19:47
Nicholas Amh21-Oct-09 19:47 
GeneralRe: Need help for CStdioFile Read mode [modified] Pin
Adam Roderick J21-Oct-09 19:54
Adam Roderick J21-Oct-09 19:54 
AnswerRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 19:38
Naveen21-Oct-09 19:38 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 20:11
Nicholas Amh21-Oct-09 20:11 
GeneralRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 20:24
Naveen21-Oct-09 20:24 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:48
Nicholas Amh21-Oct-09 21:48 
GeneralRe: Need help for CStdioFile Read mode Pin
Richard MacCutchan21-Oct-09 23:18
mveRichard MacCutchan21-Oct-09 23:18 
AnswerRe: Need help for CStdioFile Read mode Pin
theCPkid21-Oct-09 19:42
theCPkid21-Oct-09 19:42 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 20:24
Nicholas Amh21-Oct-09 20:24 
GeneralRe: Need help for CStdioFile Read mode Pin
theCPkid22-Oct-09 0:22
theCPkid22-Oct-09 0:22 
QuestionRe: Need help for CStdioFile Read mode Pin
David Crow22-Oct-09 3:25
David Crow22-Oct-09 3:25 
QuestionRead from text file Pin
sonualex21-Oct-09 19:05
sonualex21-Oct-09 19:05 
AnswerRe: Read from text file Pin
theCPkid21-Oct-09 19:26
theCPkid21-Oct-09 19:26 
GeneralRe: Read from text file Pin
sonualex21-Oct-09 20:32
sonualex21-Oct-09 20:32 
GeneralRe: Read from text file Pin
theCPkid22-Oct-09 0:25
theCPkid22-Oct-09 0: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.