Solved

Using an MDI Frame Wnd with an SDI Doc Template

Posted on 1997-02-21
1
458 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now