My MFC application needs a dialog to log the user into a database. Having already more or less implemented my main user interface, I decided to create a dialog before the user ever sees the main user interface. I instantiate a CDialog derived class in the usual way inside my CDocument derived class's constructor.
This almost works perfectly, except when the user chooses to exit, and not login. My exit button send an ID_APP_EXIT message, which causes an Unhandled exception. Why so? Is there another way to exit the application? Is placing the code in my document's constructor like this a good idea?,