This code appears to work when the bug fix posted by Marko Shade is substituted for the original CMainFrame::SwitchToForm. But all of the views here use a CDocument derived Doc. What I need is a method of handling views such as CView and CRichEditView that require differing Doc derivations.. This demo comes so close to a solution to that problem, but I do not understand how to link the Docs and the Views. Any ideas greatly appreciated. : )
How can this model be extended to allow multiple views at the same time? My app needs to have one main view of a 3d model, and then many other views for data entry, or 2d display of different components of the model. I've currently build the application around non-CView dialog boxes, (with only one open at a time to remove data synchronisation issues), but it's getting many views, and getting messy, whereas a multiple view MDI solution would be much neater.
Although it is obvious to some guru's (unlike me!), in order for this call to work, in this case a CFormView, which is being displayed has to have the style changed, using the resource editor if you wish, from "popup", to "Child", otherwise the pNewActiveView->Create call asserts.
Richard and Uday thanks a lot! Just a minor quirk, which I found will ASSERT.