MFC多文档程序如何获取当前活动文档指针
展开全部
给你一个通用的步骤吧,看不懂我再详细说(你需要的步骤是1-2-3.2):
1.CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
2.CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
3.
3.1获得视类:CMyView *pView = (CMyView *) pChild->GetActiveView();
3.2获得文档类:CDocument* pDocument=pChild -> GetActiveDocument();
1.CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
2.CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
3.
3.1获得视类:CMyView *pView = (CMyView *) pChild->GetActiveView();
3.2获得文档类:CDocument* pDocument=pChild -> GetActiveDocument();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询