Article ID: 141334
Article Last Modified on 11/21/2006
119591 How to obtain Microsoft support files from online services
119591 How to obtain Microsoft support files from online services
VSWAP32.EXE -d
CVswapApp::InitInstance
CVswapApp::SwitchView
CVswapApp::SaveActiveViewsData
The SwitchView function is included here as a reference.
CView* CVswapApp::SwitchView( UINT nIndex )
{
ASSERT( nIndex >=0 && nIndex < NUMVIEWS );
CView* pNewView = m_pViews[nIndex];
CView* pActiveView =
((CFrameWnd*) m_pMainWnd)->GetActiveView();
if ( !pActiveView ) // No currently active view.
return NULL;
if ( pNewView == pActiveView ) // Already there.
return pActiveView;
// Update Doc's data if needed
// Don't change view if data validation fails
if ( ! SaveActiveViewsData() )
{
return pActiveView;
}
m_nCurView = nIndex; // Store the new current view's index.
// Exchange view window ID's so RecalcLayout() works.
UINT temp = ::GetWindowLong(pActiveView->m_hWnd, GWL_ID);
::SetWindowLong(pActiveView->m_hWnd, GWL_ID,
::GetWindowLong(pNewView->m_hWnd, GWL_ID));
::SetWindowLong(pNewView->m_hWnd, GWL_ID, temp);
// Display and update the new current view - hide the old one.
pActiveView->ShowWindow(SW_HIDE);
pNewView->ShowWindow(SW_SHOW);
((CFrameWnd*) m_pMainWnd)->SetActiveView(pNewView);
((CFrameWnd*) m_pMainWnd)->RecalcLayout();
pNewView->Invalidate();
return pActiveView;
}
COLLECT (SDI) ENROLL (SDI) VWRPLC32 (MDI) SPLIT32 (Splitter).For more information on DDX and DDV routines, please see Technical Note 26: DDX and DDV Routines in the Microsoft Development Library.
Additional query words: mfc Vcswap32 Vcswap32vcnet
Keywords: kbhowto kbdownload kbcode kbdocview kbfile kbsample KB141334