Adding a new view to MDI 
Author Message
 Adding a new view to MDI

First of all, I have read the MSDN docs, KB, and others at CodeGuru on
switching views. The code snippets don't tell you where to add the
functions. Are there any tutorials that explain this better?

Thanks.



Sat, 10 Sep 2005 19:14:20 GMT  
 Adding a new view to MDI
I am not sure exactly what you want to do. If you want to creat a new view
with its own frame, you can use CreateNewFrame on the corresponding
doctemplate.

--
Ajay Kalra [MVP - VC++]


Quote:
> First of all, I have read the MSDN docs, KB, and others at CodeGuru on
> switching views. The code snippets don't tell you where to add the
> functions. Are there any tutorials that explain this better?

> Thanks.



Sat, 10 Sep 2005 19:24:52 GMT  
 Adding a new view to MDI


Quote:
> I am not sure exactly what you want to do. If you want to creat a new view
> with its own frame, you can use CreateNewFrame on the corresponding
> doctemplate.

> --
> Ajay Kalra [MVP - VC++]


I want to be able to open a document and view it in three different views
(same document in three views). Just as an example, if you have an RTF
document and want to display it in WYSIWYG view, plain text  view, or RTF
code view.

So I created an MDI test app from CRichEditView class. I now need to add two
new views to it and be able to switch back and forth between the three
views.  I read an article from codeguru.com on this but I am unclear on
exactly how to put it all together.



Sat, 10 Sep 2005 19:46:42 GMT  
 Adding a new view to MDI
If your views are all in the same frame, you can use a splitter to separate
the views. Have you looked at example VIEWEX in MSDN. That might be helpful.

--
Ajay Kalra [MVP - VC++]


Quote:



> > I am not sure exactly what you want to do. If you want to creat a new
view
> > with its own frame, you can use CreateNewFrame on the corresponding
> > doctemplate.

> > --
> > Ajay Kalra [MVP - VC++]

> I want to be able to open a document and view it in three different views
> (same document in three views). Just as an example, if you have an RTF
> document and want to display it in WYSIWYG view, plain text  view, or RTF
> code view.

> So I created an MDI test app from CRichEditView class. I now need to add
two
> new views to it and be able to switch back and forth between the three
> views.  I read an article from codeguru.com on this but I am unclear on
> exactly how to put it all together.



Sat, 10 Sep 2005 20:12:06 GMT  
 Adding a new view to MDI


Quote:
> If your views are all in the same frame, you can use a splitter to
separate
> the views. Have you looked at example VIEWEX in MSDN. That might be
helpful.

> --
> Ajay Kalra [MVP - VC++]


Sorry, should have stated that I will use the child frame and not a splitter
window. Simply swap the current view with a new one.


Sat, 10 Sep 2005 20:27:08 GMT  
 Adding a new view to MDI
See if the following links helps you

        http://tinyurl.com/84z5
        http://www.microsoft.com/msj/1298/c++/c++1298.htm

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------


Quote:



> > If your views are all in the same frame, you can use a splitter to
> separate
> > the views. Have you looked at example VIEWEX in MSDN. That might be
> helpful.

> > --
> > Ajay Kalra [MVP - VC++]

> Sorry, should have stated that I will use the child frame and not a
splitter
> window. Simply swap the current view with a new one.



Sat, 10 Sep 2005 20:51:46 GMT  
 Adding a new view to MDI
If you are using a different MDIChildframe for each of the views, then
CreateNewFrame will work fine.

--
Ajay Kalra [MVP - VC++]


Quote:



> > If your views are all in the same frame, you can use a splitter to
> separate
> > the views. Have you looked at example VIEWEX in MSDN. That might be
> helpful.

> > --
> > Ajay Kalra [MVP - VC++]

> Sorry, should have stated that I will use the child frame and not a
splitter
> window. Simply swap the current view with a new one.



Sat, 10 Sep 2005 20:43:52 GMT  
 Adding a new view to MDI
It would be nice if the samples could be downloaded. 131 MB is impractical
and unfair to users that have slow connections. I have a cable connection
and it still will take 20 minutes to download the entire file.


Sat, 10 Sep 2005 21:20:28 GMT  
 Adding a new view to MDI
Do I implement it in the CMainFrame class?
Do I still need to create a new document template in the
CMyApp::InitInstance()?

Most examples only _partially_ explain the process.



Sat, 10 Sep 2005 21:23:44 GMT  
 Adding a new view to MDI
You can create these whenever you want it as long as the doctemplate has
been created. You typically create the doctemplate in CMyApp::InitInstance.
All this should have been done for you by the wizard. You need to do the
additional step of creating additional views.

--
Ajay Kalra [MVP - VC++]


Quote:
> Do I implement it in the CMainFrame class?
> Do I still need to create a new document template in the
> CMyApp::InitInstance()?

> Most examples only _partially_ explain the process.



Sat, 10 Sep 2005 21:27:47 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Problem when I try to add a view in an MDI application of Visual C++

2. Creating a new view in MDI

3. Passing data when creating a new MDI VIEW

4. Adding a CScrollView in an MDI with multiple views

5. new view in MDI-app that displays plain text

6. Adding a Button to a MDI View???

7. Creating a new view in MDI

8. Add new line at the end of Rich Edit View

9. Opening a new MDI child when no MDI Child exists

10. Opening a new MDI child from a MDI Child

11. MFC MDI Multiple Views in Separate MDI Child Windows

12. How to active a view in an MDI Doc/view architecture

 

 
Powered by phpBB® Forum Software