我想请问一下if(m_IsDrawing && (nFlags & MK_LBUTTON) && m_Canvas.PtInRect(point))中有什么问题.调试报错为:error C2676: binary '&&' : 'class CPoint' does not define this operator or a conversion to a type acceptable to the predefined operator.
        本人刚学VC不久,还请各位高手多多指教.再此多谢各位了!

解决方案 »

  1.   

    CPoint类没有支持&&运算的运算符,怎么能对它的对象使用该运算捏
      

  2.   

    这个主要的功能就是实现一个画笔的作用,这里m_IsDrawing   必须是TRUE,所以你可以把这个条件,给它赋值就OK了,试试看
    ~~
      

  3.   

    在这之前做一个检测
    BOOL m_bInCanvas;
    if(m_Canvas.PtInRect(point))
    {
        m_bInCanvas = TRUE;
    }
    else
        m_bInCanvas = FALSE;
      

  4.   

    然后再if(m_IsDrawing   &&   (nFlags   &   MK_LBUTTON)   &&  m_bInCanvas)  
      

  5.   

    &&操作符两端只能是布尔型,其他所有的条件操作符也只能操作布尔型。