2021-11-15 15:04 采纳率: 100%
浏览 157
已结题

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艹学习道路的带学生

  • 写回答

1条回答 默认 最新

  • peng450 2021-11-15 18:15
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 11月24日
  • 已采纳回答 11月16日
  • 创建了问题 11月15日

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突