Solved

VC++ MDI with different view setup

Posted on 1998-08-27
2
221 Views
Last Modified: 2008-03-06
What do I need to do for the MDI application with different formviews to be open depending on the different button click instead of opening the same view everytime clicking on "New button"?
0
Comment
Question by:aung
2 Comments
 

Author Comment

by:aung
ID: 1171362
Edited text of question
0
 
LVL 2

Accepted Solution

by:
milenvk earned 100 total points
ID: 1171363
Create different document templates - a different template for each view in your InitInstance() handler. Then create a button on the toolbar and a command on the menu for each different view. Then handle the commands in your application or mainframe class and open a new specific window for the view like in the following example:

void CMyApp::OnFileNewView1()
{
    m_pTemplView1->OpenDocumentFile(NULL);  // Means create new file
}

for the View2 it could be

void CMyApp::OnFileNewView2()
{
    m_pTemplView2->OpenDocumentFile(NULL);  // Means create new file
}
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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

920 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

14 Experts available now in Live!

Get 1:1 Help Now