Solved

Using an MDI Frame Wnd with an SDI Doc Template

Posted on 1997-02-21
1
455 Views
Last Modified: 2013-11-20
I have an application that requires a single document interface but I desire that the main frame window have multiple child windows.  Is it possible to use an single document template with a MDIFrameWnd?  

It appears when I try to implement this using the app wizard to generate an SDI and then deriving the MainFrame from CMDIFrameWnd instead of CFrameWnd I don't get a default view associated with the template.  Without a default view, my document doesn't get a change to handle any commands.

What is the best way to implement an SDI app with multiple child windows in its main frame?
0
Comment
Question by:brickb
1 Comment
 
LVL 4

Accepted Solution

by:
mbhakta earned 100 total points
ID: 1300056
There are several ways in MFC to approach this problem.

- Design a CWnd based application. This doesnot use the doc/view architecture. But gives you access to mainframe look-alike facilities. Rule this out if you are using heavy-duty CDocument features.

- Design a CDialog based application. The fastest way to get what  you want. Again no View/doc. There is also a considerable increase in EXE size compared to the normal technique. But you can achieve your goal without any trouble.

- The third which is the most feasible way is to design an SDI application using APP wiz. This way you can use all the CMainframe , doc /view features. Now comes the creation of child windows in the CMainFrame. In MFC you approach this problem in a different way than using regular C. The view is the white area that covers the client are of the CMainFrame. Instead of making your child dialog's children of CMainFrame you use the CView based derived class. Now all child windows will float inside the client area of the CView.

Tip : Remember to kill these child windows before killing the view.


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now