MFC文档模式开发:(原文有Dialog绘图)
1. CChildFrame 创建类CLogin Cdialog类型;
2.创建Cdialog控件
void
CLogin::OnBnClickedOk()
{
m_editName.GetWindowTextW (cName);
m_editPassWord.GetWindowTextW(cPass);
CDialog::OnOK();
}
void CLogin::OnBnClickedOk(){m_editName.GetWindowTextW (cName);
m_editPassWord.GetWindowTextW(cPass);
CDialog::OnOK();
}
3.BOOL CGzyOaApp::InitInstance()内添加
CLogin m_login;
if (m_login.DoModal ()==IDOK)//响应上面红色字体,ID为IDOK
{
m_strSqlName=m_login.cName;
m_strSqlPassword=m_login.cPass ;
-------------------------------
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
}