在消息映射函数的条件语句在编译里出现下面这样的错误
binary '&&':'class CPoint' does not define this operator or a type acceptable to the predefined operator
句子是这样的
if(m_IsDrawing&&(nFlags&MK_LBUTTON)&&m_Canvas.PtInRect(point))
请问,这是什么错误。
如果要在这个映射函数里进行运算符重载,该怎么做!!
binary '&&':'class CPoint' does not define this operator or a type acceptable to the predefined operator
句子是这样的
if(m_IsDrawing&&(nFlags&MK_LBUTTON)&&m_Canvas.PtInRect(point))
请问,这是什么错误。
如果要在这个映射函数里进行运算符重载,该怎么做!!
你不会别干这么无聊的事吗?钻牛角尖!
if(m_IsDrawing&&(nFlags&MK_LBUTTON)&&m_Canvas.PtInRect(point))
这句在编译时编译器出现上面这样的错误提示,不知道这个是什么样的错误,该怎么改!!
加个括号
这个函数是处理WM_MOUSEMOVE这个消息的。原型是
void CPaintRamaDlg::OnMouseMove(UINT nFlags,CPoint point)
{
CDialog::OnMouseMove(nFlags, point);
}
上面那一句我是照样搬进去的
BOOL bBool = m_Canvas.PtInRect(point);
if(m_IsDrawing&&(nFlags&MK_LBUTTON)&&bBool)
...
我猜
这个错误
{
public:
C();
} c;class D
{
public:
D();
D operator <<( C& );
} d;
void main()
{
d >> c; // error
d << c; // OK, operator << defined
}