Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Child Frame windows, MDI App

Posted on 2003-10-28
7
Medium Priority
?
475 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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