单应用程序获得文档类对象指针和获得视图类对象指针办法

获得View指针:

 POSITION pos = this->GetFirstViewPosition();

 CPointCloudMeasureView *pView = NULL;

 if(pos)
  pView = (CPointCloudMeasureView *)this->GetNextView(pos);
 else
  ASSERT(false);

获得view指针的关键在于GetFirstViewPosition函数和GetNextView函数;

获得Doc指针:
 CDocument* pDoc  = ((CFrameWnd*)AfxGetMainWnd())->GetActiveDocument(); 

 ASSERT_VALID(pDoc);
 if (!pDoc)
  return false;



posted @ 2014-11-10 16:25  水蒸蛋不好吃  阅读(227)  评论(0编辑  收藏  举报