Solved

Creating other windows from main window

Posted on 1999-01-26
7
218 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Accepted Solution

by:
Seeker092397 earned 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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

11 Experts available now in Live!

Get 1:1 Help Now