I have an application using MFC Doc/View Arcitecture. My program currently starts by showing the application Frame with my form view inside as normal.
I'm now trying to add a login dialog to force users to log in before they can use the application. I've made a login dialog and it works fine. Right now, I show it (DoModal) during my view's OnInitialUpdate() Function. The login dialog doesn't close until the password is correct.
My Problem is, I want to have a cancel button on the login dialog which will close the application without showing the main window at all. Currently, if I use something like PostQuitMessage(0) or exit(0) I get memory leaks when I exit as follows:
[tt]Warning: destroying CSingleDocTemplate with live document.
Detected memory leaks!
[/tt]
How can I exit BEFORE I show my View?? If I can't, what is a way around this?
Thanks,
- Mike -
I'm now trying to add a login dialog to force users to log in before they can use the application. I've made a login dialog and it works fine. Right now, I show it (DoModal) during my view's OnInitialUpdate() Function. The login dialog doesn't close until the password is correct.
My Problem is, I want to have a cancel button on the login dialog which will close the application without showing the main window at all. Currently, if I use something like PostQuitMessage(0) or exit(0) I get memory leaks when I exit as follows:
[tt]Warning: destroying CSingleDocTemplate with live document.
Detected memory leaks!
[/tt]
How can I exit BEFORE I show my View?? If I can't, what is a way around this?
Thanks,
- Mike -