| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 660 人关注过本帖
标题:[求助]为什么我在本程序中用switch语句会出错
只看楼主 加入收藏
li202108
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-5
收藏
 问题点数:0 回复次数:0 
[求助]为什么我在本程序中用switch语句会出错

void CPathView::OnLButtonDown(UINT nFlags, CPoint point)

{

// TODO: Add your message handler code here and/or call default

CClientDC dc(this);

switch(m_choice)

{case 0:

CBrush newBrush,*pOldBrush;

newBrush.CreateSolidBrush(RGB(255,0,0));

pOldBrush=dc.SelectObject(&newBrush);

CPen newPen(PS_SOLID,1,RGB(255,0,0));

CPen* pOldPen=dc.SelectObject(&newPen);

POINT y;

y.x=point.x;

y.y=point.y;

y.x=(y.x/10)*10+5;

y.y=(y.y/10)*10+5;

dc.Rectangle(y.x-5,y.y-5,y.x+5,y.y+5);

dc.SelectObject(pOldBrush);

dc.SelectObject(pOldPen);

break;

case 1:

left_top_point=point;

break;

}

CView::OnLButtonDown(nFlags, point);

}

error C2360: initialization of 'pOldPen' is skipped by 'case' label

see declaration of 'pOldPen'

error C2360: initialization of 'newPen' is skipped by 'case' label

see declaration of 'newPen'

error C2360: initialization of 'newBrush' is skipped by 'case' label

see declaration of 'newBrush'

执行 cl.exe 时出错.

搜索更多相关主题的帖子: switch Roman Times 
2006-05-05 10:33
快速回复:[求助]为什么我在本程序中用switch语句会出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013734 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved