Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

VC++ MDI with different view setup

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
aung
Asked:
aung
1 Solution
 
aungAuthor Commented:
Edited text of question
0
 
milenvkCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

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