0
votes

I have a problem in which there is bunch of data that will be displayed in two different ways and they should always be synchronized with data . Logically i thought of exploiting the Doc/View architecture on which mfc is based . However The usage of MFC Doc/View architecture imposes the dynamic creation of document , view class by the Framework which is sth i don't want since i have to create the views myself within tab controls and DockablePane . Is there a workaround which let me take benefit of the Doc/View archiecture so i can create a view and corresponding document without the usage of dynamic creation by frameowrk ? sth like the qt's model/view technology !

2

2 Answers

2
votes

What you want can be done within the MFC doc/view framework. It just takes more study. You can prevent MFC from creating a view at new document by passing NULL as the view class to AddDocTemplate. Then you can create views where you like using MFC's dynamic creation, specifically the CreateObject method. See the MFC source code for CSplitterWnd::CreateView as an example.

1
votes

Yes, you can create two different views of the same document. If you always want both, the method MFC supports the most directly is a window with a static splitter, so you have one view in each pane of the splitter.

It's not (at all) clear what dynamic creation has to do with any of this though.