其实在你的程序的"yourapplecationname.cpp"文件中加入验证对话框就是了 CYourAppName dlg; m_pMainWnd = &dlg; CCheckBox CheckDlg; // <--- 验证对话框 if(CheckDlg.DoModal()==IDOK) //如果通过验证就进入主窗口 { int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } }而验证对话框就可以连接数据库了,然后根据数据库的记录进行你希望的操作
CYourAppName dlg;
m_pMainWnd = &dlg;
CCheckBox CheckDlg; // <--- 验证对话框
if(CheckDlg.DoModal()==IDOK) //如果通过验证就进入主窗口
{
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
}而验证对话框就可以连接数据库了,然后根据数据库的记录进行你希望的操作
而且我用的是odbc访问access