Solved

Child Frame windows, MDI App

Posted on 2003-10-28
7
458 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
has22 challenge 11 105
scoreUp challenge 14 64
Thin secure Windows 10 5 102
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 876
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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