?
Solved

Creating other windows from main window

Posted on 1999-01-26
7
Medium Priority
?
270 Views
Last Modified: 2010-04-02
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
Comment
Question by:karamba
[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
  • 3
7 Comments
 
LVL 1

Expert Comment

by:Seeker092397
ID: 1185154
What is it you are interested in exactly: the creation of a new window or handling menu item commands?


0
 

Author Comment

by:karamba
ID: 1185155
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1185156
I think, you must simply use MDI interface(see windows doc). After make Active some child Window, you must change menu and ToolBar.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Accepted Solution

by:
Seeker092397 earned 300 total points
ID: 1185157
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
 

Author Comment

by:karamba
ID: 1185158
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
 
LVL 1

Expert Comment

by:Seeker092397
ID: 1185159
Can you please format the text above so it all will be visible.
It is really hard to understand.
0
 

Author Comment

by:karamba
ID: 1185160
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

650 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