Document-view architecture in MFC

889 views Asked by At

I have a question about the necessity of using MFC's built-in document-view architecture. I was given an old dialog-based project in which I have to replace the main dialog with a frame and add a ribon. It has sort of a doc-view architecture, created without the built-in classes and I preffer to reuse it in the new version. However, if I try to bypass the CDoc and CView derivatives, normally generated by the project wizzard, all I can see is an empty window without a ribon. So... do I REALLY have to implement these built-in doc-view architecture, or am I just missing something? Isn't it possible to use the already existing code from the project?

1

There are 1 answers

4
Gautam Jain On

If you will be using multiple views & documents in your frame then it is advisable to use the existing framework's design (CDocument, CView etc).

If you are doing it only for ribbon and will be just moving your controls from dialog to frame then you can skip the standard Document/View architecture and directly instantiate ribbon control.

If you don't have to re-write a lot of code, then I would suggest that you use standard Document/View architecture as in a long run it will save a lot of time, make your app scalable to a bigger multi-doc design etc.