Click here to Skip to main content
15,893,644 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Thanks for your replies, Bob.

It actually doesn't crash when nCode is 0xFFFFFFFF or 0x00000000 (which is what it's set at when it does crash), so the nCode isn't at least obviously what's wrong. I tried putting the breakpoints back in but it kept interrupting my menu clicks by breaking, so I inserted this code first thing in CMainFrame::OnCmdMsg:
CString message;<br />
FILE * outfp;<br />
outfp = fopen("debuginfo.txt", "a");<br />
if (nID == ID_APP_EXIT)  { <br />
  message.Format("message: nID=0x%X, nCode=0x%X, this=0x%X\n", nID, nCode, this);<br />
  fputs(message, outfp);<br />
}<br />
fclose(outfp);


That will append to the a debug file and only output when the message it's handling is ID_APP_EXIT. I opened the text file and found this:
message: nID=0xE141, nCode=0xFFFFFFFF, this=0x334AA8
message: nID=0xE141, nCode=0x0, this=0x334AA8
message: nID=0xE141, nCode=0xFFFFFFFF, this=0x334AA8
message: nID=0xE141, nCode=0x0, this=0x334AA8


So this stays valid the entire time. The only thing I have in OnAppExit() is "exit(0);".

About the stack, I fixed some bugs that I could fix earlier using the stack and it helped me figure out where things went wrong. I might pass by value here but expecting an address there, giving me access violation errors. This one just puzzles me.
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 
GeneralINTERNAL COMPILER ERROR Pin
kalaichris16-Feb-05 7:35
kalaichris16-Feb-05 7:35 
GeneralRe: INTERNAL COMPILER ERROR Pin
David Crow16-Feb-05 7:43
David Crow16-Feb-05 7:43 
GeneralRe: INTERNAL COMPILER ERROR Pin
Bob Ciora16-Feb-05 10:34
Bob Ciora16-Feb-05 10:34 

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.