解决方案 »

  1.   

    void CMyView::OnPrepareDC (CDC* pDC, CPrintInfo* pInfo)
    {
       CView::OnPrepareDC(pDC, pInfo);   // If we are printing, set the mapmode and the window
       // extent properly, then set viewport extent. Use the
       // SetViewportOrg member function in the CDC class to
       // move the viewport origin to the center of the view.   if(pDC->IsPrinting()) // Is the DC a printer DC.
       {
          CRect rect;
          GetClientRect (&rect);      pDC->SetMapMode(MM_ISOTROPIC);
          CSize ptOldWinExt = pDC->SetWindowExt(1000, 1000);
          ASSERT(ptOldWinExt.cx != 0 && ptOldWinExt.cy != 0);
          CSize ptOldViewportExt = pDC->SetViewportExt(rect.Width(), -rect.Height());
          ASSERT(ptOldViewportExt.cx != 0 && ptOldViewportExt.cy != 0);
          CPoint ptOldOrigin = pDC->SetViewportOrg(rect.Width()/2, rect.Height()/2);
       }
    }
      

  2.   

    CCoreInfNetBrowView要写成CCCWell类的父类名称,也就是要调用属于自己或继承来的方法
      

  3.   

    谢谢回复,这个问题已经明白了,要先定义一个对象,再调用该对象的成员函数,现在还有一个问题,就是我在 CCCWell.cpp不同的函数里都要使用坐标转换,每个函数的作用都是在图纸中画一竖列,但是只有第一竖位置转换正确,后面的都没有转换,这是什么原因?都使用到了下面几句
                 pView->OnPrepareDC(dc);
                 dc->DPtoLP(&rc);
               Graphics graphic1(dc->GetSafeHdc());
                USES_CONVERSION;
      

  4.   

    CCoreInfNetBrowView::OnPrepareDC(dc);
    OnPrepareDC(dc); 不是静态函数    只有CCoreInfNetBrowView是当前类的父类   才可以这样调用