首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

大侠

2012-02-20 
请教各位大侠~void CChapView::OnLButtonDown(UINT nFlags, CPoint point){// TODO: Add your message han

请教各位大侠~
void CChapView::OnLButtonDown(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default

CView::OnLButtonDown(nFlags, point);
}

void CChapView::OnRButtonDown(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default

CClientDC dc(this);
p[m_PN].x=p[0].x;
p[m_PN].y=p[0].y;
m_PN++;
dc.Polyline(p,m_PN);

CView::OnRButtonDown(nFlags, point);
}

一个比例变换得程序,怎么出现了这些错误呢??
D:\visual c++\MSDev98\MyProjects\chap\chapView.cpp(139) : error C2601: 'OnLButtonDown' : local function definitions are illegal
D:\visual c++\MSDev98\MyProjects\chap\chapView.cpp(146) : error C2601: 'OnRButtonDown' : local function definitions are illegal
D:\visual c++\MSDev98\MyProjects\chap\chapView.cpp(157) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\chapView.sbr': No such file or directory
执行 bscmake.exe 时出错.


[解决办法]
新建一个单文档工程,在view里响应WM_LBUTTONDOWN和WM_RBUTTONDOWN消息,
然后,对比一下,看哪不一样(函数定义、消息入口、函数体)

至于
fatal error C1004: unexpected end of file found
看是否在类声明后面少了;号,或括号不匹配等

热点排行