注册 登录
编程论坛 VC++/MFC

关于按钮与对话框弹出的联系问题

zgjlzhlj 发布于 2010-11-07 10:41, 416 次点击
void CClientDlg::OnKEY()
{
    // TODO: Add your control notification handler code here
    a dlgKEY;
    dlgKEY.DoModal();
}

发生以下ERROR

d:\我的文档\桌面\复件 修改界面及流程图(备份)\5_1_Client可运行\ClientDlg.cpp(873) : error C2065: 'a' : undeclared identifier
d:\我的文档\桌面\复件 修改界面及流程图(备份)\5_1_Client可运行\ClientDlg.cpp(873) : error C2146: syntax error : missing ';' before identifier 'dlgKEY'
d:\我的文档\桌面\复件 修改界面及流程图(备份)\5_1_Client可运行\ClientDlg.cpp(873) : error C2065: 'dlgKEY' : undeclared identifier
d:\我的文档\桌面\复件 修改界面及流程图(备份)\5_1_Client可运行\ClientDlg.cpp(874) : error C2228: left of '.DoModal' must have class/struct/union type

执行 cl.exe 时出错

在网上查找后 得知有类似情况的问题出现,其解释是
没有包含这个类的头文件,在主对话框类开头部分加入#include "a.h"

然而,添加了#include "a.h".后,出现了新的问题
d:\我的文档\桌面\复件 修改界面及流程图(备份)奠定希望\5_1_client可运行\a.h(21) : error C2065: 'IDD_DIALOG1' : undeclared identifier
d:\我的文档\桌面\复件 修改界面及流程图(备份)奠定希望\5_1_client可运行\a.h(21) : error C2057: expected constant expression

之前有位朋友出现过我的情况的第一次情况,现在我又存在了新的问题,请哪位知道怎么弄的帮帮忙!在线等 谢谢

[ 本帖最后由 zgjlzhlj 于 2010-11-7 11:37 编辑 ]
1 回复
#2
shafeilong2010-11-08 19:28
'IDD_DIALOG1' 你改成别的ID名字了??那个对话框 ?
改回来呗  把原来的对话框的ID 替换掉
1