Exit an application
-
Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude
-
Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude
exit() ? My articles www.stillwaterexpress.com BlackDice
-
Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude
Try with this code. PostMessage(WM_COMMAND,ID_APP_EXIT); Ivan Cachicatari Blog[^] www.latindevelopers.com
-
Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude
The correct method is
PostMessage(WM_CLOSE)
.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
-
Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude
You can try
PostMessage(WM_QUIT,0,0)
too."Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta