Solved

CMDIFrameWnd in CMDIChildWnd view ?

Posted on 2002-06-10
12
596 Views
Last Modified: 2013-11-20
Is there a way to create a CMDIFrameWnd in a CMDIChildWnd view.

My firts idea was to create a CFormView with a static control an then create a new CMDIFrameWnd on this (static) CWnd.
Second idea was to create the CMDIFrameWnd directly while creating the (CMDIChildWnd) view.

I can't find in the documentation if you can have more than one CMdiFrameWnd in an app without causing some kind of problem. But I also can't find that you can't do this anywhere.

Any help would be greatly appreciated.
Samplecode also.....

Thorsten Koch
0
Comment
Question by:thkoch
  • 4
  • 3
  • 2
  • +1
12 Comments
 
LVL 16

Expert Comment

by:AlexNek
ID: 7067155
2 thkoch
I don't understand why you need it. Did you try to use splitter window?
Try to read MSDN "Frame Window Topics".
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 7067284
I'm also curios why you need this...
0
 

Author Comment

by:thkoch
ID: 7069198
What I'm trying to do is some kind of a nested structure of mdi childs. I do not need a splitter window.
There is an example on the net where a dialog contains a single child window
(http://www.codetools.com/docview/dfv.asp) like i mentioned as the first idea, but this is an sdi example. I there a way (probably even for the given example) to replace the sdi CFrameWnd with a mdi CMidFrameWnd to have a various number of child windows in this dialog.

Thorsten
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 16

Expert Comment

by:AlexNek
ID: 7069712
2 thkoch
>..to replace the sdi CFrameWnd with a mdi CMidFrameWnd
What do you expect in this way? A small window in the dialog where is smaller windows.

IMHO, this is wrong way to UI. Lets try to explain us which UI architecture do you need?
0
 

Author Comment

by:thkoch
ID: 7069779
Currently i am writing a ui for virtual robot controller (vrc). This vrc ui should be able to display different (various) information for each 'virtual' robot, like joint values, I/Os, multiple programm windows for each robot....

Simple solution for this, open a mdichild for each information to be displayed -> to many windows, to many windows displaying same kind of information (joint values robot 1, joint values robot 2, 3, 4..) -> confusing.

So i would like to open a mdi child for each robot, containig several windows, displaying only the information for this robot, while the information for other robots are displayed on other 'main/vrc' midi childs. I can not use a dialog within the 'main/vrc' mdi child, because the number of windows/information, available for each robot, is dynamic.

BTW: The ui can only run as a single instance on a computer, due to RPC-Calls.

Hope this helps

Thorsten

0
 

Author Comment

by:thkoch
ID: 7069804
Currently i am writing a ui for virtual robot controller (vrc). This vrc ui should be able to display different (various) information for each 'virtual' robot, like joint values, I/Os, multiple programm windows for each robot....

Simple solution for this, open a mdichild for each information to be displayed -> to many windows, to many windows displaying same kind of information (joint values robot 1, joint values robot 2, 3, 4..) -> confusing.

So i would like to open a mdi child for each robot, containig several windows, displaying only the information for this robot, while the information for other robots are displayed on other 'main/vrc' midi childs. I can not use a dialog within the 'main/vrc' mdi child, because the number of windows/information, available for each robot, is dynamic.

BTW: The ui can only run as a single instance on a computer, due to RPC-Calls.

Hope this helps

Thorsten

0
 
LVL 31

Accepted Solution

by:
Zoppo earned 200 total points
ID: 7070114
Well, I'd suggest to use MDI frame with on MDI child per
robot which contains simple windows (no MDI childs).

I think it's nearly impossible (at least it will cost
a lot sweat and nerves) to implement MDIChild in MDIFrame
in MDIChild ... MFC isn't that flexible I think.

But it should be simple to handle a small list of
dynamically created windows within each MDI child.
It can be done the as is i.e. in MS Access in
'Relationship'-view for tables.

ZOPPO
0
 

Author Comment

by:thkoch
ID: 7070218
There was a post in another forum where someon was able to get a CMDiFrameWnd in a CMDiChildWnd and created a new standard child. But this was long time ago (1998) and i can't remember the way he did it. The only thing i remember that it was quite simple. Looking at the sample i already mentioned, nearly half way should be done.

Thorsten
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 7070838
2 thkoch
I think, it is easy to realize your own solution that tries to change MFC in such way. You'll always find a new error.
First, if have many robots, how do you want to arrange each Robot window? Do you want to show all information at once or you want to expand only robot that you need? How about many robots, can you arrange many robots window at the screen?

>multiple programm windows for each robot.
Why you need many windows. Which kind of information you want to show: single line text, graphics?

You can use different UI architecture like a grid, list or tabbed controls.
By sample, each Robot can be represented with one grid window. Each cell of the grid can contain different kind of information, like text or bitmap.

This "Robot Grid" windows you can insert in the other Grid.
Each Robot Grid window can be expandable.
0
 

Expert Comment

by:shinebean
ID: 7075912
maybe I can help you.

I developed a project - a client.
This client has 7 childwindows, and every child window is a
CMDIChildWnd. 7 kinds of different mdichildwnd. But there is only one child window activated at a time. You can change it.

//////////////////////////////////////////////////////
//                   codes
//////////////////////////////////////////////////////

//class CIndexFrame : public CMDIChildWnd
CIndexFrame m_wndIndexFrame;

//creat a mdichildwnd
     if(m_wndIndexFrame.GetSafeHwnd() == NULL)
     {
          m_wndIndexFrame.Create(NULL,NULL);
     }

//attention!!!!!
//reload this virtual function
void CIndexFrame::PostNcDestroy()
{
     // TODO: Add your specialized code here and/or call the base class
     
        //delete the following line !!!!!!!!!
//     CMDIChildWnd::PostNcDestroy();
}
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 123
notReplace  challenge 53 131
matchUp  challenge 6 64
sumHeights2  challenge 7 107
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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