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

一个简单的画图程序~该怎么处理

2012-01-23 
一个简单的画图程序~~我写OnMouseMove()函数时,是这样写的:voidCPaintORamaDlg::OnMouseMove(UINTnFlags,C

一个简单的画图程序~~
我写OnMouseMove()函数时,是这样写的:
void   CPaintORamaDlg::OnMouseMove(UINT   nFlags,   CPoint   point)  
{
if   (m_IsDrawing   &&   (nFlags   &   MK_LBUTTON)   &&   m_Canvas.PtInRect(point))
{
CClientDC   dc(this);
dc.MoveTo(m_LineStart);
dc.LineTo(point);
m_LineStart   =   point;

}
}
为什么会出现下列问题呢?
--------------------Configuration:   PaintORama   -   Win32   Debug--------------------
Compiling...
PaintORamaDlg.cpp
D:\project\PaintORama\PaintORamaDlg.cpp(136)   :   error   C2676:   binary   '&& '   :   'class   CPoint '   does   not   define   this   operator   or   a   conversion   to   a   type   acceptable   to   the   predefined   operator
Error   executing   cl.exe.

请高手赐教,谢谢~~



[解决办法]
怪不得,m_IsDrawing我还以为是BOOL呢,如果是CPoint,这个类型没有重载&&运算符
[解决办法]
PtInRect里面的参数要求是一个POINT结构而不是类。

热点排行