e:\VS.NET\MainFrm.cpp(201): error C2361: “default”标签跳过“myop”的初始化操作

mykeyboard 2003-09-20 05:40:28
void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值

switch(nID)
{
case ID_SYSTEM_A_ABOUT:
theApp.OnAppAbout();
break;
case ID_SYSTEM_A_EXIT:
this->DestroyWindow();
break;
case ID_SYSTEM_A_OPTION:
CMy_Options myop;
myop.m_str=str;
if(myop.DoModal()==IDOK)
str=myop.m_str;
break;
default:
CFrameWnd::OnSysCommand(nID, lParam);
break;
}


//}
}


这是怎么回事?
...全文
301 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
SeainBlue 2003-09-20
  • 打赏
  • 举报
回复
语法要求就是这样的
可以查看msdn
在索引或者INDEX属性页中输入C2361,就可以看到错误解释了
例子中写的很明白
mykeyboard 2003-09-20
  • 打赏
  • 举报
回复
to SeainBlue(爱海)

为什么?
SeainBlue 2003-09-20
  • 打赏
  • 举报
回复
在switch语句中不可以有定义部分
如果必须要用
则定义部分需要用{ }括起来
SeainBlue 2003-09-20
  • 打赏
  • 举报
回复
case ID_SYSTEM_A_OPTION:
{ CMy_Options myop;
myop.m_str=str;
if(myop.DoModal()==IDOK)
str=myop.m_str;
}
break;
驱动器 D 中的卷没有标签。 卷的序列号是 B837-9C57 D:\download\USB助手 源码 2008-12-30 08:44 . 2008-12-30 08:44 .. 2002-10-07 15:21 1,536 ChildFrm.cpp 2002-10-07 15:21 1,397 ChildFrm.h 2002-10-07 15:21 17,103 DevicesDlg.cpp 2002-10-07 15:21 2,330 DevicesDlg.h 2008-12-30 08:44 18 dir list.bat 2008-12-30 08:44 0 dir.txt 2002-10-07 15:21 5,469 Exporter.cpp 2002-10-07 15:21 2,098 Exporter.h 2002-10-07 15:21 4,947 ExportLogDlg.cpp 2002-10-07 15:21 1,712 ExportLogDlg.h 2002-10-07 15:21 6,135 MainFrm.cpp 2002-10-07 15:21 1,894 MainFrm.h 2002-10-07 15:21 2,954 MyMemFile.cpp 2002-10-07 15:21 1,682 MyMemFile.h 2002-10-07 15:21 1,582 ProgressStatusBar.cpp 2002-10-07 15:21 982 ProgressStatusBar.h 2002-10-07 15:21 4,754 ReadMe.txt 2002-10-07 15:21 2,271 ReadmeDlg.cpp 2002-10-07 15:21 1,264 ReadmeDlg.h 2008-12-30 08:41 Res 2002-10-07 15:21 4,735 Resource.h 2002-10-07 15:21 14,777 SetupDIMgr.cpp 2002-10-07 15:21 1,943 SetupDIMgr.h 2002-10-07 15:21 11,745 SnoopyPro.cpp 2002-10-07 15:21 7,277 SnoopyPro.dsp 2002-10-07 15:21 2,704 SnoopyPro.h 2002-10-07 15:21 23,501 SnoopyPro.rc 2002-10-07 15:21 704 SnoopyPro.reg 2008-12-11 19:15 16,773 SnoopyPro.vcproj 2002-10-07 15:21 211 StdAfx.cpp 2002-10-07 15:21 1,212 StdAfx.h 2002-10-07 15:21 57,986 URB.cpp 2002-10-07 15:21 9,642 URB.h 2002-10-07 15:21 3,613 URBLogListBox.cpp 2002-10-07 15:21 1,454 URBLogListBox.h 2002-10-07 15:21 13,776 URBLogListCtrl.cpp 2002-10-07 15:21 3,209 URBLogListCtrl.h 2002-10-07 15:21 3,192 URLStatic.cpp 2002-10-07 15:21 1,285 URLStatic.h 2002-10-07 15:21 11,998 USBLogDoc.cpp 2002-10-07 15:21 2,929 USBLogDoc.h 2002-10-07 15:21 28,721 USBLogView.cpp 2002-10-07 15:21 3,470 USBLogView.h 42 个文件 286,985 字节 3 个目录 12,592,160,768 可用字节
MFC经典程序.rar C:. │ ├─28 选择立方体 │ │ AAAAAAA.CPP │ │ Animate.aps │ │ Animate.clw │ │ Animate.cpp │ │ Animate.dsp │ │ Animate.dsw │ │ Animate.h │ │ Animate.ncb │ │ Animate.plg │ │ Animate.rc │ │ AnimateDoc.cpp │ │ AnimateDoc.h │ │ AnimateView.cpp │ │ AnimateView.h │ │ MainFrm.cpp │ │ MainFrm.h │ │ ReadMe.txt │ │ RESOURCE.H │ │ StdAfx.cpp │ │ StdAfx.h │ │ Animate.opt │ │ │ └─RES │ Animate.ico │ Animate.rc2 │ AnimateDoc.ico │ Toolbar.bmp │ ├─18 BTNtest │ │ BtnTest.aps │ │ BTNTEST.CPP │ │ BTNTEST.DSP │ │ BTNTEST.DSW │ │ BTNTEST.H │ │ BTNTEST.ncb │ │ BtnTest.plg │ │ BtnTest.rc │ │ BTNTESTDLG.CPP │ │ BTNTESTDLG.H │ │ CANIBUTTON.CPP │ │ CANIBUTTON.H │ │ CDIB.CPP │ │ CDIB.H │ │ RESOURCE.H │ │ STDAFX.CPP │ │ STDAFX.H │ │ Btntest.opt │ │ │ └─RES │ BALDIE.ANI │ BTNTEST.ICO │ BTNTEST.RC2 │ FLAG.BMP │ FREE-GRAY.BMP │ FREE.BMP │ GLOBE_BTN.BMP │ GRAY_GLOBE.BMP │ H_POINT.CUR │ PLANE.CUR │ ├─11 oubleGripper │ │ DoubleGripper.aps │ │ DoubleGripper.cpp │ │ DoubleGripper.dsp │ │ DoubleGripper.dsw │ │ DoubleGripper.h │ │ DoubleGripper.ncb │ │ DoubleGripper.opt │ │ DoubleGripper.plg │ │ DoubleGripper.rc │ │ DoubleGripperDoc.cpp │ │ DoubleGripperDoc.h │ │ DoubleGripperToolBar.cpp │ │ DoubleGripperToolBar.h │ │ DoubleGripperView.cpp │ │ DoubleGripperView.h │ │ MainFrm.cpp │ │ MainFrm.h │ │ ReadMe.txt │ │ Resource.h │ │ StdAfx.cpp │ │ StdAfx.h │ │ │ └─res │ DoubleGripper.ico │ DoubleGripper.rc2 │ DoubleGripperDoc.ico │ Toolbar.bmp │ ├─09 TITLEANIM │ │ ANIMATEICON.CPP │ │ ANIMATEICON.H │ │ Mainfrm.cpp │ │ MAINFRM.H │ │ ReadMe.txt │ │ resource.h │ │ StdAfx.cpp │ │ StdAfx.h │ │ TITLEANIM.001 │ │ TITLEANIM.APS │ │ TITLEANIM.CLW │ │ TITLEANIM.CPP │ │ TI

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧