Click here to Skip to main content
15,898,571 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Efficiency question Pin
Maximilien2-Mar-09 13:31
Maximilien2-Mar-09 13:31 
AnswerRe: Efficiency question Pin
«_Superman_»2-Mar-09 17:15
professional«_Superman_»2-Mar-09 17:15 
AnswerRe: Efficiency question Pin
Eytukan2-Mar-09 20:17
Eytukan2-Mar-09 20:17 
QuestionReplacing contents of a file Pin
Neelesh K J Jain2-Mar-09 9:58
Neelesh K J Jain2-Mar-09 9:58 
AnswerRe: Replacing contents of a file Pin
CPallini2-Mar-09 10:09
mveCPallini2-Mar-09 10:09 
GeneralRe: Replacing contents of a file Pin
Rajesh R Subramanian2-Mar-09 19:53
professionalRajesh R Subramanian2-Mar-09 19:53 
JokeRe: Replacing contents of a file Pin
CPallini2-Mar-09 21:18
mveCPallini2-Mar-09 21:18 
QuestionOnAppExit not called when X button clicked Pin
TimmySRX2-Mar-09 9:49
TimmySRX2-Mar-09 9:49 
I have a multi-tabbed app that on exit is trying to override the OnAppExit() function to call a bit of house claening code so that I don't have a memory leak. My problem is that if I use the file->menu->exit route it will call the OnAppExit() function and I can call my function to house clean. But if I close by using the X in the upper right pane it never calls the exit function and a leak occurs. I have tried all I know to figure out why but am lost so here I am. I am fairly green to MFC so any tips or help would be appreiceated. The code that I have done is:

void CdatamaxApp::OnAppExit()
{
if( IsOnline() == TRUE )
{
int nRetValue;
nRetValue = MessageBox( NULL,"Still ONLINE, YES to Quit, NO returns to App", TEXT("Datamax Exit"), MB_ICONERROR|MB_YESNO );
if(nRetValue == IDYES)
{
OnGoOffline();
AfxGetMainWnd()->;PostMessage ( WM_CLOSE );
}
else
{

}
}
else
{
AfxGetMainWnd()->;PostMessage ( WM_CLOSE );
}
}

How can I debug or set a breakpoint to figure out why this function doesn't get called when I close app with the x close button vs using the file menu, don't they both issue the same event?
AnswerRe: OnAppExit not called when X button clicked Pin
Stuart Dootson2-Mar-09 10:15
professionalStuart Dootson2-Mar-09 10:15 
GeneralRe: OnAppExit not called when X button clicked Pin
TimmySRX2-Mar-09 11:05
TimmySRX2-Mar-09 11:05 
GeneralRe: OnAppExit not called when X button clicked Pin
Iain Clarke, Warrior Programmer2-Mar-09 23:04
Iain Clarke, Warrior Programmer2-Mar-09 23:04 
QuestionSendKeys won't work Pin
Ran42-Mar-09 8:49
Ran42-Mar-09 8:49 
AnswerRe: SendKeys won't work Pin
led mike2-Mar-09 9:49
led mike2-Mar-09 9:49 
GeneralRe: SendKeys won't work Pin
Ran42-Mar-09 10:14
Ran42-Mar-09 10:14 
GeneralRe: SendKeys won't work Pin
CPallini2-Mar-09 10:19
mveCPallini2-Mar-09 10:19 
AnswerRe: SendKeys won't work Pin
«_Superman_»2-Mar-09 17:33
professional«_Superman_»2-Mar-09 17:33 
GeneralRe: SendKeys won't work Pin
davidjaybrown3-Mar-09 8:49
davidjaybrown3-Mar-09 8:49 
GeneralRe: SendKeys won't work Pin
«_Superman_»3-Mar-09 15:59
professional«_Superman_»3-Mar-09 15:59 
QuestionCompile Error Actual linking error ....Can someone help. Pin
FISH7862-Mar-09 8:01
FISH7862-Mar-09 8:01 
AnswerRe: Compile Error Actual linking error ....Can someone help. Pin
Jonathan Davies2-Mar-09 8:05
Jonathan Davies2-Mar-09 8:05 
AnswerRe: Compile Error Actual linking error ....Can someone help. Pin
Cedric Moonen2-Mar-09 8:06
Cedric Moonen2-Mar-09 8:06 
GeneralRe: Compile Error Actual linking error ....Can someone help. Pin
FISH7862-Mar-09 8:09
FISH7862-Mar-09 8:09 
GeneralRe: Compile Error Actual linking error ....Can someone help. Pin
Cedric Moonen2-Mar-09 8:12
Cedric Moonen2-Mar-09 8:12 
GeneralRe: Compile Error Actual linking error ....Can someone help. Pin
Cedric Moonen2-Mar-09 8:14
Cedric Moonen2-Mar-09 8:14 
GeneralRe: Compile Error Actual linking error ....Can someone help. Pin
FISH7862-Mar-09 8:34
FISH7862-Mar-09 8: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.