在视图的成员函数中建立一个无模式的对话框!
成员函数:
void CVido_exe1View::OnId2()
{
// TODO: Add your command handler code here
if(this->m_pDialog1==NULL)
{
m_pDialog1=new CDialog1(this);
m_pDialog1->Create(CDialog1::IDD);
}
m_pDialog1->ShowWindow(SW_SHOW);
m_pDialog1->SetFocus();
}
第一次还可以编译,运行,只是在调用到这个函数的时候,有错误发生,
第二次在m_pDialog1->Create(CDialog1::IDD,this);多写了个this
就出现了下列的问题
-------------------Configuration: vido_exe1 - Win32 Debug--------------------
Compiling...
vido_exe1View.cpp
WINOCC.CPP
D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINOCC.CPP(416) : error C2027: use of undefined type 'CHandleMap'
d:\program files\microsoft visual studio\vc98\mfc\include\afxstat_.h(109) : see declaration of 'CHandleMap'
D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINOCC.CPP(416) : error C2227: left of '->LookupPermanent' must point to class/struct/union
Generating Code...
Error executing cl.exe.vido_exe1.exe - 2 error(s), 0 warning(s)
我怎么改都有这个错误.把牵扯到对话框类的所有东西都删除,还有这个错误,特别是那个cl.exe,想请问大家是个什么东西.跪求了!
成员函数:
void CVido_exe1View::OnId2()
{
// TODO: Add your command handler code here
if(this->m_pDialog1==NULL)
{
m_pDialog1=new CDialog1(this);
m_pDialog1->Create(CDialog1::IDD);
}
m_pDialog1->ShowWindow(SW_SHOW);
m_pDialog1->SetFocus();
}
第一次还可以编译,运行,只是在调用到这个函数的时候,有错误发生,
第二次在m_pDialog1->Create(CDialog1::IDD,this);多写了个this
就出现了下列的问题
-------------------Configuration: vido_exe1 - Win32 Debug--------------------
Compiling...
vido_exe1View.cpp
WINOCC.CPP
D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINOCC.CPP(416) : error C2027: use of undefined type 'CHandleMap'
d:\program files\microsoft visual studio\vc98\mfc\include\afxstat_.h(109) : see declaration of 'CHandleMap'
D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINOCC.CPP(416) : error C2227: left of '->LookupPermanent' must point to class/struct/union
Generating Code...
Error executing cl.exe.vido_exe1.exe - 2 error(s), 0 warning(s)
我怎么改都有这个错误.把牵扯到对话框类的所有东西都删除,还有这个错误,特别是那个cl.exe,想请问大家是个什么东西.跪求了!
解决方案 »
- 关于PDF Creator编程
- 灵异事件:增加了拖放功能后,整个VS2008无法运行。重装后,现象仍然是:.....
- 二个类如何数据很好的共享!代码如下
- 关于钩子的问题
- variant关于VT_CY类型如何读取转换?
- 最近我想买一本关于vc++6.0的类库的书,有高手帮我推荐一个吗?
- 键盘输入控制问题?
- 大家帮我看看错在哪?
- 如果改变Edit或者是list控件里面的滚动条的颜色?
- 大家好,我想请问在那里可以找到关于用net meeting来进行开发的文档?
- 如何判断某个软件是否安装,比如判断Excel是否安装?
- 工作区的ResourceView打不开,跳出提示“This file is already open in an editor”,如何才能恢复呢?
vc在编译的时候自动为工程中添加了winocc.cpp文件,只要把它删掉就行了!
void CVido_exe1View::OnId2()
{
// TODO: Add your command handler code here
if(this->m_pDialog1==NULL)
{
m_pDialog1=new CDialog1(this);
m_pDialog1->Create(CDialog1::IDD);
}
m_pDialog1->ShowWindow(SW_SHOW);
m_pDialog1->SetFocus();
}
程序能正常运行,但是每次调用这个函数后就会出错,调试是
m_pDialog1->ShowWindow(SW_SHOW);有问题BOOL CWnd::ShowWindow(int nCmdShow)
{
ASSERT(::IsWindow(m_hWnd));
说这个断言有问题:m_hWnd=???,怎么会这样?
if (m_pCtrlSite == NULL)
return ::ShowWindow(m_hWnd, nCmdShow);
else
return m_pCtrlSite->ShowWindow(nCmdShow);
}
这句执行成功了没有? 如果没有成功,也就是窗口没有创建, 则调用ShowWindow就会断言错
或者从QQ联系:361577203
m_pDialog1=NULL;谢谢大家,我要散分了