Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using an MDI Frame Wnd with an SDI Doc Template

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 96
Complete beginner needs help making a cron job 9 125
Best tools for Backup and restore of Wordpress site 6 57
only14 challenge 19 81
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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

838 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