Solved

Child Frame windows, MDI App

Posted on 2003-10-28
7
467 Views
Last Modified: 2013-11-20
I create an MDI app, with no doc view support, select all defaults.
I get a default About dialog.
I can move/drag this dlg out of the main mdi frame.
how do i create a form (and say launch it from the menu) that will behave like an mdi child (i.e. stay inside teh main frame.) just like a child frame window. I wish to add simple controls (text boxes, comboboxes, tab ctrls ...) on this form. So i would like to use the resource editor the way we use it to develop dialog boxes.

i work in mfc like one month out of a yr. and am eager to hear that most beginers get lost in the doc-view architecture, which is actually supposed to help. Honestly, i find plain windows programing more understandable than mfc prog. comments/arguments welcome.
and help.
0
Comment
Question by:tubelight
[X]
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
  • 3
  • 2
7 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 9639457
Use CFormView class.
0
 

Author Comment

by:tubelight
ID: 9639961
can you elaborate pl.
I tried this -
 Insert a dialog resource of type IDD_FORMVIEW, add a simple button on it. Use class wiz to attach a class to this resource. this class is derived from CFormView.
 The default constructor and destructor of this class were made protected by class wiz. So i made them public, to resolved a compile error.
 In the menu handler code, i try to do following -
    myFrmView.ShowWindow(SW_SHOW);
 where myFrmView is of type CMyFrmView:public CFormView

 this gives me a debug assertion when i invoke the menu item.

help.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9640200
When you create new MDI application using MFC Application Wizard, select CFormView class instead of CView on the last Wizard step.
0
 

Author Comment

by:tubelight
ID: 9644012
ok. I had tried this actually and found myself lost in doc-view.
It allows me to create my form from the file new menu.
how do i create the form window from a menu say 'User details'.
or in other words, how to place a formview inside a CFrameWnd or CMdiChildWnd derived class and create/show/destroy at my will.
I thought i can bypass doc-view arch and simply create a menu based app that can launch diff Forms (not dialogs) that can capture user data (and stay Inside the main frame window).

increasing points as a thanks-so-far
0
 

Accepted Solution

by:
tubelight earned 0 total points
ID: 9704063
I think i resolved it

summary - use SDI no doc view support and create Modeless dialog box with the default view of main frame as parent of dlg. This keeps the dialog boxes inside the main frame wnd.

details -
use SDI app with no doc view.
The main frame will have a m_wndView as its default view.
create your dialog boxes as you want in res editor attach a class (derived from cdialog) to it.
In your main frame wnd class, add ptr to your dialog class so created.
add a menu from which you want to launch this dlg. add a menu handler in your main frame wnd class.
in this handler,
         p_MyDlg = new CMyDlg();
         p_MyDlg->Create(IDD_MyDlgResource, &m_wndView);
         p_MyDlg->ShowWindow(SW_SHOW);

Note- take necessary care to destroy the modeless dlg box.

Another approach later on i was pointed to is

http://www.codeguru.com/dialog/mdi_child_dialog.shtml
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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