Solved

Creating other windows from main window

Posted on 1999-01-26
7
229 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

911 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

23 Experts available now in Live!

Get 1:1 Help Now