Hi guys, I am writing project for bank operation in MFC, before running my application i have to check the username and password. But i have some problem in my code, my main frame window is closed after enter username and password.Any one tell me the reason.....
class CLoginDialog : public CDialog //MyDialog class
{
////
};
class CBankApp : public CWinApp
{
public:
CBankApp();
~CBankApp();
BOOL InitInstance();
}
CBankFrameWnd : public CFrameWnd
CBankApp::CBankApp
{
}
CBankApp::~CBankApp()
{
}
BOOL CBankApp::InitInstance()
{
CLoginDialog *pDlg = new CLoginDialog();
m_pMainWnd = pDlg;
if(pDlg->DoModal() == IDOK)
{
//Verify userName password,
if Valid User then assign frame window in m_pMainwnd and return TRUE ...
CBankFrameWnd *pWnd = new CBankFrameWnd();
m_pMainWnd = pWnd;
pWnd -> ShowWindow(m_nCmdShow);
pWnd -> UpdateWindow();
return TRUE;
}
else
return FALSE;
}
Thanks in Advance