Solved

CMDIFrameWnd in CMDIChildWnd view ?

Posted on 2002-06-10
12
594 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 30

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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 30

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

12 Experts available now in Live!

Get 1:1 Help Now