为什么视频里能通过编译,而我这里却不能编译呢?用的都是VC6.0
,而且也是按视频的来操作的,不明白为什么!错误信息:
Compiling...
CALCULATORDlg.cpp
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(189) : error C2059: syntax error : 'constant'
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2228: left of '.pSubmenu' must have class/struct/union type
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2227: left of '->InsertMenuA' must point to class/struct/union
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2059: syntax error : 'constant'
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(191) : error C2228: left of '.bAllow' must have class/struct/union type
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(192) : error C2228: left of '.SetWindowTextA' must have class/struct/union type
执行 cl.exe 时出错.CALCULATORDlg.obj - 1 error(s), 0 warning(s)
,而且也是按视频的来操作的,不明白为什么!错误信息:
Compiling...
CALCULATORDlg.cpp
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(189) : error C2059: syntax error : 'constant'
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2228: left of '.pSubmenu' must have class/struct/union type
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2227: left of '->InsertMenuA' must point to class/struct/union
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(190) : error C2059: syntax error : 'constant'
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(191) : error C2228: left of '.bAllow' must have class/struct/union type
G:\MFC程序\MFC工程\CALCULATOR\CALCULATORDlg.cpp(192) : error C2228: left of '.SetWindowTextA' must have class/struct/union type
执行 cl.exe 时出错.CALCULATORDlg.obj - 1 error(s), 0 warning(s)
解决方案 »
- WebServices 调用COM DLL问题。。。急!!!!
- 编译Google浏览器子项目的问题
- ATL IE插件开发,如何判断当前进行的是POST动作呢?
- 除了两个自定义的映射模式,其他映射模式都有自己的"窗口"大小吧.
- 谁能帮我解释一下扫描编程的问题?(关于SockRaw)
- 怎么样才能动态执行一个函数?比如。。。(请进)
- 都说windows网络技术这本书好,一看到是...京京的...顿时吓了一跳
- 请教RTF文件词法分析器???
- 在CListCtrl 的派生类中初始化List Control
- 求救:怎样在线程里调用DLL?(或者怎样实现线程与DLL之间的通信?)
- 如何在cdhtmldialog中限制HTML显示范围
- 大家一起来晒晒偶们这帮IT民工各自的体质吧!
{
if (!bAllow)
{
CMenu *pmenu = GetMenu(), // 获取菜单的指针
*pSubmenu = pmenu->GetSubMenu( 0); //获取子菜单的指针
错误提示:GetSubMenu()参数不仅一个 pSubmenu->InsertMenu(0, MF_BYPOSITION.IDM_SUM, "求和");
pSubmenu->InsertMenu(1, MF_BYPOSITION.IDM_AVERAGE, "求平均");
错误提示:left of '->InsertMenuA' must point to class/struct/union
bAllow = TRUE;
m_Allow.SetWindowText("禁止计算");
}
else
{
CMenu *pmenu = GetMenu(),
*pSubmenu = pmenu->GetSubMenu(0); pSubmenu->DeleteMenu(IDM_SUM, MF_BYCOMMAND);
pSubmenu->DeleteMenu(IDM_AVERAGE, MF_BYCOMMAND);
bAllow = FALSE;
m_Allow.SetWindowText("允许计算");
}
}void CCALCULATORDlg::OnClose()
{
OnOK();
}void CCALCULATORDlg::OnSum()
{
double sum = 0;
char strOfNum[10]; m_Edit1.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit2.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit3.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit4.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
sprintf(strOfNum, "%.3f", sum);
m_Edit5.SetWindowText(strOfNum);}void CCALCULATORDlg::OnAverage()
{
double sum = 0,
average = 0;
char strOfNum[10]; m_Edit1.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit2.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit3.GetWindowText(strOfNum, 10);
sum += atof(strOfNum);
m_Edit4.GetWindowText(strOfNum, 10);
sum += atof(strOfNum); average = sum / 4;
sprintf(strOfNum, "%.3f", average);
m_Edit6.SetWindowText(strOfNum);
}