I'm writing an SDI program which requires three views of the same document. I know its possible, MS published a sample application called collection that does this (in MSDN that shipped with vc++ 6).
According to the example, this should create the new view when placed in the CMainFrame class. But when I try to compile it I get (among others) a CINV_trial3View is not a class or namespace name error. Are there special requirements for a view class, other than setting the base class to (in my case) CFormView? I know you have to write the constructor yourself and call CFormView::CFormView() at the end of it, but that should be it, right?
CRuntimeClass* pNewViewClass = RUNTIME_CLASS(CINV_trial3View);
CCreateContext context;
context.m_pNewViewClass = pNewViewClass;
context.m_pCurrentDoc = GetActiveDocument();
CView* PNewView = STATIC_DOWNCAST(CView, CreateView(&context));
pNewView->ShowWindow(SW_SHOW);
pNewView->OnInitialUpdate();
SetActiveView(pNewWindow);
RecalcLayout();
m_nCurrentExample = nCmdID;
Thanks in advance!