int nchoic=m_combobx.GetCurSel();
switch(nchoic)
{ case0 :
pwndctrl=new CStatic;
((CStatic*)pwndctrl->Create(_T("static text"),WS_VISIBLE,CRect(180,40,300,70),this,1));
break;
其中用到函数pwndctrl->Create这条语句报错,error C2660: 'Create' : function does not take 5 parameters,CStatic::Create这个函数是5个参数没错啊,可是鼠标放在creat上时提示的是CWnd::Create,这个函数倒是7个参数,为什么会这样, CStatic不是从 CWnd派生来的吗,怎么解决啊?
switch(nchoic)
{ case0 :
pwndctrl=new CStatic;
((CStatic*)pwndctrl->Create(_T("static text"),WS_VISIBLE,CRect(180,40,300,70),this,1));
break;
其中用到函数pwndctrl->Create这条语句报错,error C2660: 'Create' : function does not take 5 parameters,CStatic::Create这个函数是5个参数没错啊,可是鼠标放在creat上时提示的是CWnd::Create,这个函数倒是7个参数,为什么会这样, CStatic不是从 CWnd派生来的吗,怎么解决啊?
解决方案 »
- 求推荐p2p编程资料
- 谁用过swf sdk
- 窗口中一张随窗口大小改变时也改变位置的图片的显示问题
- 画图时创建兼容DC后,还用CreateCompatibleBitmap()么?
- 想自己做一个打印机监控,请赐教
- 如何才能象flashget一样下载文件后,文件的修改日期和服务器上的一样。
- ***疑难杂争: DLL里面的窗口怎么不能自己"刷新" ??? ***
- 如何取的字体的外框?
- 请大家讨论一下UltraEdit中的宏的运用~~
- 关于VC++6.0运行时出现vcspawn.exe错误的问题
- 请问,错误信息:fatal error C1853: 'Release/md500000.pch' is not a precompiled header file created with this compiler
- iocp模型,客户端closesocket或者直接退出,服务器总是得到ERROR_NETNAME_DELETED 错误!!!
((CStatic*)(pwndctrl->Create()),他是先调用Create函数,在把结果转换为CStatic*类型。所以会报错。楼上的写法是正确的。((CStatic*)pwndctrl)->Create把pwndctrl转为CStatic*类型,再调用Create函数。我是路过,帮楼上的解释一下。
不然编译器识别成别的了