Page 1 of 1

VS 2008 Compiler Error: CControlBar base class undefined

Posted: Thu Jun 05 2008
by Devteam
Some of our projects that used to compile perfectly under VS 2003 and VS 2005 would not compile anymore under VS2008. The error code obtained is:
error C2504: 'CControlBar' : base class undefined

The error comes when compiling the afxole.h MFC header files:
#include <afx.h>
#include <afxext.h>
#include <afxole.h>
#include <afxtempl.h>

After some research, we found out that afxole includes afxext which includes afxwin which itself includes afxole. In afxwin.h, the following include towards the end of the file causes the error:
#ifdef _M_CEE
#include <atliface.h>
#include <afxole.h>

The solution:
(arguably not very clean)
  • In afxwin.h, comment out the useless include <afxole.h> line in order to compile our projects.