关于获取view类指针的问题
我在一个SDI工程中,新建一个窗口,其中有如下语句:
CNewFrame* pFrame = new CNewFrame();
CCreateContext Context;
CComprehensiveDoc* docObj=new CComprehensiveDoc;
Context.m_pCurrentDoc=docObj;
Context.m_pNewViewClass=RUNTIME_CLASS(CEditView);
//.............
然后在CNewFrame::OnExport()函数中用:
CEditView* pView=(CEditView*)GetActiveView();
却无法获得该view类的指针,这是为什么呢?应该怎么办呢?