Solved

Child Frame windows, MDI App

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 47
if loop in java 3 114
Path of Workbook 3 45
Thin secure Windows 10 5 49
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

18 Experts available now in Live!

Get 1:1 Help Now