Solved

Child Frame windows, MDI App

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

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

Suggested Solutions

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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

23 Experts available now in Live!

Get 1:1 Help Now