• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Creating other windows from main window

How do you create a window(s) with its own menu items and toolbars when clicking on a menu item in the main window? Each window can perform different task and update common data. I am using VC++5.0 on NT.  
0
karamba
Asked:
karamba
  • 3
  • 3
1 Solution
 
Seeker092397Commented:
What is it you are interested in exactly: the creation of a new window or handling menu item commands?


0
 
karambaAuthor Commented:
I am interested in creating a new window. I have tried making another class that is a subclass of CFrameWnd that contains its own menu and toolbar (same as main window for the moment) and I use "new" to create a new instance of the window when pressing a menu button (CMainFrame::OnNewWindow(..)). That works fine ...but I then type in Create with the default parameters and an ASSERT error occurs. I think I have to update the registry somehow but I don't know how.
0
 
AlexVirochovskyCommented:
I think, you must simply use MDI interface(see windows doc). After make Active some child Window, you must change menu and ToolBar.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Seeker092397Commented:
I believe that CHKBOOK sample from MSDN library will help you.
It shows how to create multiple views and frames.
The points to look at are:
CChkBookApp::InitInstance()
CChkBookApp::OpenDocumentFile()
CMainFrame::OnViewCheck()
CMainFrame::CreateOrActivateFrame()

Hope it help.
Best regards.
0
 
karambaAuthor Commented:
Thank you very much for the chkbook sample but I have a feeling that there must be no way of having another window outside the main window (i.e.looks like two application running but infact is only one). Basically, I want to create an application that looks like it is running two separate applications with its own main window (toolbars and menus) and child windows but they can communicate with the same data structure. That is because I am already joining two existing application. I would appreciate any information on this ...including a negative one!!  
0
 
Seeker092397Commented:
Can you please format the text above so it all will be visible.
It is really hard to understand.
0
 
karambaAuthor Commented:
Thank you very much for the chkbook sample, it is really helpful.

However, I have a feeling that there is no way of creating another
CWinApp object in the same application (thus having two separate
Window frames e.g. for a single SDI application).

It would look like one is running two applications.

I have decided that it will be easier to do it like in the CHKBOOK
example.
       
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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