首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

创建非模态对话框时的棘手有关问题?哦

2013-01-08 
创建非模态对话框时的棘手问题??!在线等哦--------Configuration: fifth - Win32 Debug------------------

创建非模态对话框时的棘手问题??!在线等哦
--------Configuration: fifth - Win32 Debug--------------------
Compiling...
fifthDlg.cpp
G:\the process of studying\2.2 vc++\4.7\fifth\fifthDlg.cpp(63) : error C2511: 'CFifthDlg::CFifthDlg' : overloaded member function 'void (class CWnd *)' not found in 'CFifthDlg'
        g:\the process of studying\2.2 vc++\4.7\fifth\fifthdlg.h(14) : see declaration of 'CFifthDlg'
G:\the process of studying\2.2 vc++\4.7\fifth\fifthDlg.cpp(191) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
这是我添加了代码出现的问题,我并没有修改相关的类名啊!!????????????
void CFifthDlg::OnOK() 
{
// TODO: Add extra validation here
if((pdlg!=NULL)&&IsWindow(pdlg->m_hWnd))
{
        AfxMessageBox("The dialogue is already created!");
pdlg->ShowWindow(SW_SHOW);
}
else
{
pdlg=new dlg1(NULL);
}
if(!::IsWindow(pdlg->m_hWnd))
{
pdlg->Create(IDD_DIALOG2,NULL);
pdlg->ShowWindow(SW_SHOW);
}
CDialog::OnOK();
}

[解决办法]
你多踩踩吧
[解决办法]

引用:
貌似是函数重载的问题啊 你的函数void CFifthDlg::OnOK() 和CDialog::OnOK(); 有冲突了 吧你CFifthDlg类里的OK()函数 设置成virtual形式的就可以了


再不就是把CDialog里的OK()设置成virtual  忘了 反正是重载
[解决办法]
你是否将你类声明中的默认构造函数注释掉或者修改了?
[解决办法]
直接在构造函数中写 pdlg = NULL  

热点排行