[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

CMDIFrameWnd in CMDIChildWnd view ?

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
thkoch
Asked:
thkoch
  • 4
  • 3
  • 2
  • +1
1 Solution
 
AlexNekCommented:
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
 
ZoppoCommented:
I'm also curios why you need this...
0
 
thkochAuthor Commented:
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
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
AlexNekCommented:
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
 
thkochAuthor Commented:
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
 
thkochAuthor Commented:
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
 
ZoppoCommented:
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
 
thkochAuthor Commented:
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
 
AlexNekCommented:
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
 
shinebeanCommented:
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now