VC++密码登录运行时出错误

来源:百度知道 编辑:UC知道 时间:2024/05/15 12:08:46
我在BOOL CMyHelloApp::InitInstance()
加上了 m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
CPasswordDialog Dlg;
if(Dlg.DoModal() != IDOK)
return false;
if(Dlg.m_password != "admin")
{
AfxMessageBox("Wrong Password! Exit Application!");
return false;
}
return TRUE;
编译提示没有错误,但是在运行时提示MFC遇到问题。
想问一下怎么回事?
头文件#include "PasswordDialog.h"我有加在上边
Dlg.m_password 是CString类型的

这样就不关程序的事了,你的代码没错的,从其他方面看看有没有问题。

兄弟,我完全复制你这段代码,运行良好。

你的Dlg.m_password 是什么类型