C++BUILDER编程问题


这个程序是箭头所指的地方出错了吗
新建塌中一个对话框作为登陆框冲衫歼,拖入控件,两个编辑框和两个按钮,接着为它创建一个类,并添加一个变量m_Password

在CDialogApp::InitInstance()函数中的适当位散冲置增加如下代码:
BOOL CDialogApp::InitInstance()
{
......//前面省略了,只需添加如下就行了
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
CPasswordDialog cDlg;
if(cDlg.DoModal ()==IDOK)
{
if(cDlg.m_Password !=1234)
{
AfxMessageBox("口令错误,确定后将退出程序。");
return FALSE;
}
}