主题:点击登录按钮,跳不出来登录对话框界面,大家帮忙
是VC++ 数据库移植一书中的例题,我觉得它这个SetDlgStatus()函数有问题,但我是新手看不出来,大家帮忙忙
void CStuManageDlg::OnLoginMenu()
{
// TODO: Add your command handler code here
SetDlgStatus();
m_LoginDlg = new CLoginDlg;
m_LoginDlg->Create(IDD_LOGIN_DLG, this);
status[0] = TRUE;
}
void CStuManageDlg::SetDlgStatus()
{
if(status[0])
{
m_LoginDlg->DestroyWindow();
status[0] = FALSE;
}
if(status[1])
{
m_StudentDlg->DestroyWindow();
status[1] = FALSE;
}
/* if(status[2])
{
m_PhotoDlg->DestroyWindow();
status[2] = FALSE;
}
if(status[3])
{
m_ExperienceDlg->DestroyWindow();
status[3] = FALSE;
}
if(status[4])
{
m_DepartmentDlg->DestroyWindow();
status[4] = FALSE;
}
if(status[5])
{
m_CourseDlg->DestroyWindow();
status[5] = FALSE;
}
if(status[6])
{
m_ScoreDlg->DestroyWindow();
status[6] = FALSE;
}
if(status[7])
{
m_StatusDlg->DestroyWindow();
status[7] = FALSE;
}
if(status[8])
{
m_EncPunDlg->DestroyWindow();
status[8] = FALSE;
}
if(status[9])
{
m_UserDlg->DestroyWindow();
status[9] = FALSE;
}*/
}
void CStuManageDlg::OnLoginMenu()
{
// TODO: Add your command handler code here
SetDlgStatus();
m_LoginDlg = new CLoginDlg;
m_LoginDlg->Create(IDD_LOGIN_DLG, this);
status[0] = TRUE;
}
void CStuManageDlg::SetDlgStatus()
{
if(status[0])
{
m_LoginDlg->DestroyWindow();
status[0] = FALSE;
}
if(status[1])
{
m_StudentDlg->DestroyWindow();
status[1] = FALSE;
}
/* if(status[2])
{
m_PhotoDlg->DestroyWindow();
status[2] = FALSE;
}
if(status[3])
{
m_ExperienceDlg->DestroyWindow();
status[3] = FALSE;
}
if(status[4])
{
m_DepartmentDlg->DestroyWindow();
status[4] = FALSE;
}
if(status[5])
{
m_CourseDlg->DestroyWindow();
status[5] = FALSE;
}
if(status[6])
{
m_ScoreDlg->DestroyWindow();
status[6] = FALSE;
}
if(status[7])
{
m_StatusDlg->DestroyWindow();
status[7] = FALSE;
}
if(status[8])
{
m_EncPunDlg->DestroyWindow();
status[8] = FALSE;
}
if(status[9])
{
m_UserDlg->DestroyWindow();
status[9] = FALSE;
}*/
}