【求助】关于MFC动态贴图

harmergo 2013-09-07 10:51:26
单击鼠标使图片移动,编译时出错,提示:
--------------------Configuration: 贴图且移动 - Win32 Debug--------------------
Compiling...
贴图且移动View.cpp
F:\与学习有关的文档\贴图且移动\贴图且移动View.cpp(117) : error C2065: 'rect' : undeclared identifier
F:\与学习有关的文档\贴图且移动\贴图且移动View.cpp(119) : error C2039: 'DelectDC' : is not a member of 'CDC'
f:\软件安装\mfc\include\afxwin.h(636) : see declaration of 'CDC'
执行 cl.exe 时出错.

贴图且移动View.obj - 1 error(s), 0 warning(s)


函数如下:
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CDC *pdc=GetDC();
CRect r;
GetClientRect(&r);
ktPeople.SelectObject(m_ktPeople);
pdc->Rectangle(rect);
pdc->BitBlt (point.x,point.y,256,256,&ktPeople,0,0,SRCCOPY);
pdc->DelectDC ();

CView::OnLButtonDown(nFlags, point);
}
...全文
90 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
max_min_ 2013-09-08
  • 打赏
  • 举报
回复

error C2065: 'rect' : undeclared identifier
'DelectDC' : is not a member of 'CDC'
//错误这么明显,自己再好好看看代码吧!
harmergo 2013-09-08
  • 打赏
  • 举报
回复
引用 1 楼 max_min_ 的回复:

error C2065: 'rect' : undeclared identifier
'DelectDC' : is not a member of 'CDC'
//错误这么明显,自己再好好看看代码吧!
麻烦说详细一点,我是新手,对这个完全不懂,这是我尝试的第一个程序,谢谢了~~

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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