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"?
aungAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
milenvkConnect With a Mentor Commented:
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
 
aungAuthor Commented:
Edited text of question
0
All Courses

From novice to tech pro — start learning today.