Re: trying to get active view pointer from cmainframe
I am in MainFrame and i want to call view's derived classes function.
it is possible with above mentioned method.
void CMainFrame::StepLine(CString Line)
CTritonSpiritBoardApp *app =(CTritonSpiritBoardApp *)
POSITION Pos = app->GetFirstDocTemplatePosition();
CDocTemplate * pTem = app->GetNextDocTemplate(Pos);
POSITION DocPos = pTem->GetFirstDocPosition();
CDocument * pDoc = pTem->GetNextDoc(DocPos);
POSITION ViewPos = pDoc->GetFirstViewPosition();
while(ViewPos != NULL)
CTritonSpiritBoardView * pView = (CTritonSpiritBoardView
but the problem is that all the messages alway's go to same view.
i will explain in detail.
class CTritonSpiritBoardDoc : public CDocument //document class
class CTritonSpiritBoardView : public CView //view class
now in this application user can open more than one files at a time
suppose (a.c) (b.c) that mean two chld window's are present and i have
created them using OpenDocumentFile("path");
i am getting filename and line no from other process.
before coming to cmainframe function i am bringing that child window to
now i am in CMainFrame and i want the function in cview should get
the window i just brought to front.
For this do i need to do enumeration of document objects?
but how i will make distinction i have got only file name. and that is
present on windows title and by using i have already made that window
so if know the solution please tell me.
and one more thing why that MDIGetActive() is asserting
GetActiveFrame() is also asserting.
Thanks and regards