CXXView与CMainFrame之间的调用

如下图 首先CMainFrame是C*View类的父类

在这里插入图片描述1、CView类调用CMainFrame
添加头文件 #include “MainFrm.h”
void CGisTestView::OnDraw(CDC
pDC)
{
CGisTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// _MoveWindow();
// _OpenArea();
((CMainFrame *)GetParentFrame())->myView=this;//完成对CMainFrame类的成员变量的设置**
CGisEditView::OnDraw(pDC);
// TODO: add draw code for native data here
}

猜你喜欢

转载自blog.csdn.net/haodawei123/article/details/87838149