Click here to Skip to main content
15,900,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ16-Feb-05 11:17
LighthouseJ16-Feb-05 11:17 
GeneralRe: Puzzling Runtime Error Pin
Steve Mayfield16-Feb-05 13:47
Steve Mayfield16-Feb-05 13:47 
GeneralRe: Puzzling Runtime Error Pin
Bob Ciora16-Feb-05 14:03
Bob Ciora16-Feb-05 14:03 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ16-Feb-05 14:26
LighthouseJ16-Feb-05 14:26 
GeneralRe: Puzzling Runtime Error Pin
Steve Mayfield16-Feb-05 14:52
Steve Mayfield16-Feb-05 14:52 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ16-Feb-05 15:04
LighthouseJ16-Feb-05 15:04 
GeneralRe: Puzzling Runtime Error Pin
Bob Ciora17-Feb-05 0:56
Bob Ciora17-Feb-05 0:56 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ17-Feb-05 4:01
LighthouseJ17-Feb-05 4:01 
I understand what you mean, I knew clicking the X or double-clicking the upper-left command box was different from the menus exit because the former still works, but I didn't know how the app handles each way.

I commented out the status bar because of the problems it's giving me which you may or may not be aware of branched off of my original thread starter.

When I add that code and I click on just File in the menu, it breaks at that point with this on the stack:
489gui.exe!CMainFrame::OnCmdMsg(unsigned int nID=0x0000e141, int nCode=0xffffffff, void * pExtra=0x0012f120, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 128    C++<br />

I tried stepping through anyway and everything seemed in order, but then again, I started to lose understand of what is happening.

I added to the if statement to catch when the ID_APP_EXIT nID is received and the nCode is 0x00000000 which is the case when the program crashes. However, both cases in which nCode is 0xFFFFFFFF and 0x00000000 happens before the menu is drawn, prematurely stopping the program before the instance in time we are waiting for when the Exit menu option is selected.

If I remove the breakpoint, I just noticed something, I don't think it's been there before, but 4 levels up from the CMainFrame::OnCmdMsg call, that the proper exit procedure is called, C489guiApp::OnAppExit(). It looks like my app is handling the menu click right but like you say, however something is getting destroyed and then is attempted to be used which crashes my app.
GeneralRe: Puzzling Runtime Error Pin
Bob Ciora17-Feb-05 6:14
Bob Ciora17-Feb-05 6:14 
GeneralRe: Puzzling Runtime Error Pin
Bob Ciora17-Feb-05 6:29
Bob Ciora17-Feb-05 6:29 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ17-Feb-05 8:34
LighthouseJ17-Feb-05 8:34 
GeneralRe: Puzzling Runtime Error Pin
Bob Ciora18-Feb-05 2:35
Bob Ciora18-Feb-05 2:35 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ18-Feb-05 5:08
LighthouseJ18-Feb-05 5:08 
GeneralRe: Puzzling Runtime Error Pin
Ryan Binns16-Feb-05 17:45
Ryan Binns16-Feb-05 17:45 
GeneralRe: Puzzling Runtime Error Pin
LighthouseJ16-Feb-05 18:34
LighthouseJ16-Feb-05 18:34 
Questionhow to plot graph? Pin
gaurangjanodia16-Feb-05 8:17
gaurangjanodia16-Feb-05 8:17 
AnswerRe: how to plot graph? Pin
rocky_pulley16-Feb-05 8:22
rocky_pulley16-Feb-05 8:22 
AnswerRe: how to plot graph? Pin
Andrew Walker16-Feb-05 11:56
Andrew Walker16-Feb-05 11:56 
Questionsave options using registry or file? Pin
Mohammad Tarik16-Feb-05 8:17
Mohammad Tarik16-Feb-05 8:17 
AnswerRe: save options using registry or file? Pin
rocky_pulley16-Feb-05 8:26
rocky_pulley16-Feb-05 8:26 
AnswerRe: save options using registry or file? Pin
Ravi Bhavnani16-Feb-05 9:23
professionalRavi Bhavnani16-Feb-05 9:23 
AnswerRe: save options using registry or file? Pin
Mohammad Tarik16-Feb-05 9:49
Mohammad Tarik16-Feb-05 9:49 
AnswerRe: save options using registry or file? Pin
ThatsAlok16-Feb-05 18:00
ThatsAlok16-Feb-05 18:00 
GeneralBinary serial communications Pin
ed7115516-Feb-05 8:09
ed7115516-Feb-05 8:09 
GeneralRe: Binary serial communications Pin
Ravi Bhavnani16-Feb-05 8:15
professionalRavi Bhavnani16-Feb-05 8:15 

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.