帮忙看看是 错哪了~ 做登录~~~错误了 要弹出对话框提示~~~提示后仍然可以继续跳转到登录页面int count = 0; while (1) { CLoginDlg dlg(this); if (dlg.DoModal() == IDOK) { if (用户名&&密码) break; else { count++; if (count > 3) //次数太多,退出 } } } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int count = 0;BOOL Is=FALSE while (count<3 && ! Is) { CLoginDlg dlg(this); if (dlg.DoModal() == IDOK) { if (用户名&&密码) Is=TRUE; else count++; } } if(! Is) return; 不在意的话,可以用goto,goto在这里用 会显的很好理解,而且也是近距离goto 不需要while循环,在dlg的onoK函数中处理,就可以.//dlg的构造函数test_logoin::test_logoin(CWnd* pParent /*=NULL*/) : CDialog(test_logoin::IDD, pParent){ //{{AFX_DATA_INIT(test_logoin) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT count = 0; }void test_logoin::OnOK() { // TODO: Add extra validation here if (用户名&&密码) { CDialog::OnOK(); } else { count++; if (count > 3) //次数太多,退出 } } CProgressaCtrl的SetPos显示问题 关于用ADO操作Oracle 遇到一个C++基本问题求解释 socket客户端,关闭套接字是应该关闭 send里面的套接字还是最开始定义的那个套接字啊? 如何改变状态栏的背景色 动态数组的问题 新手提问(关于delete),谢谢! 怎样让一个控件透明? windows匿名管道问题..创建进程时失败...附上代码. run-time类是怎么回事? 如何使程序编译后的Hash码都一样?? 如何使程序编译后的Hash码都一样??
BOOL Is=FALSE
while (count<3 && ! Is)
{
CLoginDlg dlg(this);
if (dlg.DoModal() == IDOK)
{
if (用户名&&密码)
Is=TRUE;
else
count++;
}
}
if(! Is)
return;
test_logoin::test_logoin(CWnd* pParent /*=NULL*/)
: CDialog(test_logoin::IDD, pParent)
{
//{{AFX_DATA_INIT(test_logoin)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
count = 0; }
void test_logoin::OnOK()
{
// TODO: Add extra validation here
if (用户名&&密码)
{
CDialog::OnOK();
}
else
{
count++;
if (count > 3)
//次数太多,退出
}
}