C++运行软件提示脚本错误提示:错误C2227:离开必须指向类/结构/联盟,请问如何修改,谢谢

左边必须指向类/结构/联合/泛型类型 - 我的异常网当前位置:& &&&左边必须指向类/结构/联合/泛型类型左边必须指向类/结构/联合/泛型类型&&网友分享于:&&&搜索量:566次
场景:“GetDlgItem”: 函数不接受 一 个参数,“-&SetWindowTextA”的左边必须指向类/结构/联合/泛型类型“GetDlgItem”: 函数不接受 1 个参数,“-&SetWindowTextA”的左边必须指向类/结构/联合/泛型类型void age2(double a){ if(a&=0.3)
GetDlgItem(IDC_EDITR)-&SetWindowText(&一般&); else if(a==0.5||a==0.4)
GetDlgItem(IDC_EDITR)-&SetWindowText(&良好&); else
GetDlgItem(IDC_EDITR)-&SetWindowText(&优秀&);}void judge2(double a,double b,double c){ if(a&b)
else if(b&c)
}}请高人指教!!!------解决方案--------------------
把age2做成对话框的成员函数,不要全局函数,如下:CMyDialog::age2(...)当然,你也可把CMyDialog对象穿进去。void age2(CDialog* pDlg, double a)
------解决方案--------------------是的, 应该漏掉了函数作用域,是对话框的成员函数void CMyDialog::age2(double a){//......}
------解决方案--------------------这个怎么可能会漏呢?你写函数的习惯不好啊应该是先输入void然后把CMyDialog粘过来然后敲::从列表里选成员函数这样就不会出错了
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关文章 12345678910 Copyright & &&版权所有C++ 的好心人帮我看看啊
错在哪里 谢谢了_编程吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:186,235贴子:
C++ 的好心人帮我看看啊
错在哪里 谢谢了收藏
步骤1 新建Win32 Application 工程 名为MFCDemo 步骤2 建Text File 名为MFCDemo.cpp步骤3 在工程设置里 改 Use MFC in a shared DLL#include&afxwin.h&class CMFCDemoApp:public CWinAPP{public:virtual BOOL InitInstance();};class CmainFrame:public CFrameWnd{public :CmainFrame();};CmainFrame::CmainFrame(){Create(NULL,"windows");}BOOL CMFCDemoApp::InitInstance(){m_pMainWnd = new CmainFrame();m_pMainWnd-&ShowWindow(SW_SHOW);m_pMainWand-&UpdateWindow();}CMFCDemoApp theA编译后 错误 :\access+C++\C++\MFCDemo\MFCDemo.cpp(3) : error C2504: 'CWinAPP' : base class undefinedD:\access+C++\C++\MFCDemo\MFCDemo.cpp(18) : error C2065: 'm_pMainWnd' : undeclared identifierD:\access+C++\C++\MFCDemo\MFCDemo.cpp(18) : error C2440: '=' : cannot convert from 'class CmainFrame *' to 'int'This conversion requires a reinterpret_cast, a C-style cast or function-style castD:\access+C++\C++\MFCDemo\MFCDemo.cpp(19) : error C2227: left of '-&ShowWindow' must point to class/struct/unionD:\access+C++\C++\MFCDemo\MFCDemo.cpp(20) : error C2065: 'm_pMainWand' : undeclared identifierD:\access+C++\C++\MFCDemo\MFCDemo.cpp(20) : error C2227: left of '-&UpdateWindow' must point to class/struct/union执行 cl.exe 时出错. MFCDemo.obj - 1 error(s), 0 warning(s)
编程说难也不难,说容易也不容易,如果你从来没有接触过编程,建议你选一家培训机构学习;达内专注编程培训已有15年,在编程培训行业内口碑还是相对比较不错的,可以考虑!
CWinAPP 没有定义 头文件不全 你要做什么
你看的是mfc关键技术之初始化啊
#include&afxwin.h&class CMFCDemoApp:public CWinApp{public: virtual BOOL InitInstance();};class CmainFrame:public CFrameWnd{public : CmainFrame();};CmainFrame::CmainFrame(){Create(NULL,"windows");}BOOL CMFCDemoApp::InitInstance(){
m_pMainWnd = new CmainFrame(); m_pMainWnd-&ShowWindow(SW_SHOW); m_pMainWnd-&UpdateWindow();}CMFCDemoApp theA
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或2016年10月优秀大版主2016年8月优秀大版主
2016年9月 总版技术专家分月排行榜第二
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。

我要回帖

更多关于 eclipse运行错误提示 的文章

 

随机推荐