Article ID: 138722
Article Last Modified on 11/21/2006
#if _MFC_VER < 0x0320 ... #endifdirectives. Please note that these directives are essential for the code to be compatible with later versions of MFC.
// mainfrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#if _MFC_VER < 0x0320
// IMPORTANT : Conditional compilation directives are
// necessary to maintain compatibility with future versions of MFC
#include <afxpriv.h>
#endif
...
#if _MFC_VER < 0x0320
// IMPORTANT : Conditional compilation directives are
// necessary to maintain compatibility with future versions of MFC
///////////////////////////////////////////////////////////////////////////
//
// _AFX_BARINFO - used for docking serialization
class _AFX_BARINFO : public CObject
{
public:
// Implementation
_AFX_BARINFO();
// Attributes
UINT m_nBarID;
BOOL m_bVisible;
BOOL m_bFloating;
BOOL m_bHorz;
BOOL m_bDockBar;
CPoint m_pointPos;
CPtrArray m_arrBarID;
CControlBar* m_pBar;
virtual void Serialize(CArchive& ar);
BOOL LoadState(LPCTSTR lpszProfileName, int nIndex);
BOOL SaveState(LPCTSTR lpszProfileName, int nIndex);
};
#endif
void CMainFrame::OnClose()
{
// SaveBarState saves everything but the number of Columns in the
// Palette; you need to do that yourself.
SaveBarState(_T("General"));
#if _MFC_VER < 0x0320
// IMPORTANT : Conditional compilation directives are
// necessary to maintain compatibility with future versions of MFC
CDockState state;
state.LoadState(_T("General"));
for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++)
{
_AFX_BARINFO* pInfo = (_AFX_BARINFO*)state.m_arrBarInfo[i];
int nSize = pInfo->m_arrBarID.GetSize();
while ((nSize!=0) && (pInfo->m_arrBarID[nSize-1]==NULL))
{
nSize--;
pInfo->m_arrBarID.RemoveAt(nSize);
}
if (nSize)
pInfo->m_arrBarID.InsertAt(nSize, (void*)NULL);
}
state.SaveState(_T("General"));
#endif
Additional query words: 2.00 2.10 3.0 3.1 3.00 3.10
Keywords: kbbug kbcode kbfix kbnoupdate kbuidesign KB138722