Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using multiple views

Status
Not open for further replies.

sumedha77

Programmer
Sep 1, 2000
7
LK
hi,
I'm using vc++6.I have a mdi application. I need to implement 2 different views
for one document. I created the views. and added two templates as follows.

CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_ZZZTYPE,
RUNTIME_CLASS(CZzzDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CZzzView));
AddDocTemplate(pDocTemplate);

pDocTemplate = new CMultiDocTemplate(
IDR_ZZZTYPE,
RUNTIME_CLASS(CZzzDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CNewView));
AddDocTemplate(pDocTemplate);

Right. so far so good. Now this is what I want to do.
I want the CZzzView to load as default every time the application runs,
and the CNewView to load if the user selects to do so from the menu. how can I do this?
Any help is greatly appreciated. thank you.
regards
sumedha77
 
Here is where I found the solution to the exact same problem. Make sure you follow the directions exactly and it will work. After you get it running go ahead and modify it.

The link is:
mspress.microsoft.com/prod/books/sampchap/4110.htm#122

Hope it helps.
Paul K.
 
look at Microsoft VC++ book .In the chapter Multiple views .
The function is given SwitchToView();That helps you 100% [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top