c++没有与这些操作数匹配的运算符

问题描述:

问题卡了很多天,csdn各种方法都试过了,没改明白

void CPrecisionCamView::OnDraw(CDC* pDC)
{
    CPrecisionCamDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
        return;
    //////////////////////////////////////////////////////////////////////////
    if (pDoc->myView != NULL)       ///////此处!=报错///////
    {    
        CRect aRect;
        GetWindowRect(aRect);
        if(myWidth != aRect.Width() || myHeight != aRect.Height()) {
        myWidth = aRect.Width();
        myHeight = aRect.Height();
        ::PostMessage ( GetSafeHwnd() , WM_SIZE , SW_SHOW , myWidth + myHeight*65536 );
        }
        pDoc->myView->Redraw();
    }
}

img

转到定义
Handle(V3d_View) myView;

继续转

class V3d_View : public Standard_Transient
{
public:
  //! Initializes the view.
  Standard_EXPORT V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
  //! Initializes the view by copying.
  Standard_EXPORT V3d_View (const Handle(V3d_Viewer)& theViewer, const Handle(V3d_View)& theView);
  //! Default destructor.
  Standard_EXPORT virtual ~V3d_View();
//(此处是开源软件的代码)

一位刚踏上c艹学习道路的带学生

去看看 myView 在 CPrecisionCamView中是指针吗?