I changed the InitInstance() of my dialog app to:
dlg = new CMyDlg;
m_pMainWnd = dlg;
// Return TRUE to start the application message pump
The problem is that when I close the dialog, it disappears, but I still the process running in the task manager. What else do I need to do to ensure that my application closes all the way?