Two View files

Can you have two view files in a project like "CMyappView" and "CMyapp1view". If yes, How do you create them?
How do you link them ?
Who is Participating?
guruprasad031298Connect With a Mentor Commented:
You can have multiple views in your project. Create these views through the class wizard, by deriving CMyappView and CMyapp1view from the CView or any one of the associated view classes. You need to click on Add Class button on the Classwizard for this.

Once you create the views, you need to attach them to the document so that you can manipulate the views properly. Get the help on CDocument for this. 'AddView', 'RemoveView', 'GetFirstViewPosition', 'GetNextView', 'UpdateAllViews' and 'SetActiveView' of CFrameWnd should be of interest to you. You can use these MFC functions to achieve your objective. 'AddView' gives a detailed example of manipulating multiple views.

Hope this helps !!!
Two views are created when you use splitter window. Both viewes are attached to the same document.
sramAuthor Commented:
I am not interesyed in splitter windows it has to be in one window. The second view file is message mapped from the first and the second view file also has code in the ondraw function.
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.

All Courses

From novice to tech pro — start learning today.