Hello,
I have this issue.
I have a view in a pane of a splitter and I switch the view inside the pane. I do something like that.
Context.m_pNewViewClass=RUNTIME_CLASS(CConfigViewPlugin);
Context.m_pCurrentDoc=pView->GetDocument();
Context.m_pCurrentFrame=this;
Context.m_pNewDocTemplate= Context.m_pCurrentDoc->GetDocTemplate();
Context.m_pLastView=(CView*)m_wndSplitter.GetPane(0,1);
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0, 1,RUNTIME_CLASS(CConfigViewPlugin),paneSize1, &Context);
pView=(CConfigViewRec*)m_wndSplitter.GetPane(0,1);
pView->GetParentFrame()->RecalcLayout();
m_wndSplitter.RecalcLayout();
Now, my problem is, when I delete the old view, mfc destroy the document, i tryed to pass to the new view a NULL document and NULL doctemplate, but I would like to preserve the document and pass it to the new view,, How can I do?