how to add show/hide Cviews?

Hi,
i have 4 views in splitterpanes in one window..and other views are in otherwindows.how to show/hide by clicking toolbarbuttons?
CView* CMainFrame::SelectView(UINT nViewID)
{


      CView* pNewView = ((CTresManApp*)AfxGetApp())->GetView(nViewID);

      if(pNewView)
      {
            SwitchToView(pNewView);      
      }
      
      
      return pNewView;

}
CView* CMainFrame::SwitchToView(CView *pNewView)
{
      CView* pOldActiveView = GetActiveView();
//      CView* pOldActiveView = ((CTresManApp*)AfxGetApp())->GetView(1);


      CDocument* pActiveDocument = GetActiveDocument();

      ASSERT(pOldActiveView != NULL);
      ASSERT(pActiveDocument != NULL);
      ASSERT_VALID(pOldActiveView);
      ASSERT(pOldActiveView->GetDocument() == pActiveDocument);

      if (pNewView != pOldActiveView)
      {
            
            // Show the newly active view and hide the inactive view.
                  
                  pNewView->ShowWindow(SW_SHOW);  
                  pOldActiveView->ShowWindow(SW_HIDE);
                  SetActiveView(pNewView);

      }
      return pOldActiveView;

}
presently i have activeview it enables by clicking respective toolbar buttons but i want to show all 4 views in one window by clicking one toolbar button.
is it possible to activate morethan 1 view at a time?..
srikadiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alb66Commented:
In order to hide/show a view you must show/hide its frame window:

pNewView->GetParentFrame()->ShowWindow(SW_SHOW);  
pOldActiveView->GetParentFrame()->ShowWindow(SW_HIDE);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZoppoCommented:
Hi,

@alb66: this doesn't work for splitter windows.

I think you'll have to delete the view to hide and create a new view to show - you can find a sample code at http://www.codeguru.com/cpp/w-d/splitter/article.php/c1533/ - there's a function 'CMainFrame::OnView1' which demonstrates this.

Hope that helps,

ZOPPO
0
alb66Commented:
Yes, my code show/hide all the views in the splitter window. May be I misunderstood the question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.