VS 2008 Compiler Error: CControlBar base class undefined

Amyuni's Development Team would like to share with fellow developers general information about Windows and Web development. These are issues encountered by Amyuni's team and were either solved or pending solution.
Post Reply
Posts: 119
Joined: Fri Oct 14 2005
Location: Montreal

VS 2008 Compiler Error: CControlBar base class undefined

Post 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.
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Post Reply