afxComCtlWrapper undeclared identifier

I

Ian Harding

I am investigating the upgrade of a VC++ 6 project to build in VS 2005.

There is a compiler error in one of the MFC files - afxcomctl32.inl.
The message is: error C2065: 'afxComCtlWrapper' : undeclared identifier.

The odd thing is that if I hover over afxComCtlWrapper in the source
code, the intellisense shows that it is declared and right-click "Go to
Declaration" takes me to line 25 of afxwin.h which contains

#define afxComCtlWrapper
static_cast<CComCtlWrapper*>(AfxGetModuleState()->m_pDllIsolationWrappers[_AFX_COMCTL32_ISOLATION_WRAPPER_INDEX])

I'm confused. How can the IDE find the declaration but suffer amnesia
when it comes to build the project?

My best guess is that a project setting or something in one of our
header files somewhere is somehow undefining the symbol. Some of the
source was written over 10 years ago and uses a mixture of MFC, ATL, STL
contributed by a lot of different people so it wouldn't be the first
time we've found something strange which might have made sense at the
time but caused problems down the line.

I can't find anything useful on Google groups or web search, can anyone
offer any suggestions as to what to try next?

Thanks,
Ian
 
G

Guest

Is it possible for you to post a code snippet that reproduces this behaviour
so that we can see what happens exactly?

without that, my only guess is that VC_EXTRA_LEAN or WIN32_LEAN_AND_MEAN is
defined, which excluded some stuff from the header files.

kind regards,
Bruno.
 
I

Ian Harding

Bruno said:
Is it possible for you to post a code snippet that reproduces this behaviour
so that we can see what happens exactly?

without that, my only guess is that VC_EXTRA_LEAN or WIN32_LEAN_AND_MEAN is
defined, which excluded some stuff from the header files.

kind regards,
Bruno.

Got it! stdafx.h contained this:

#define _AFX_NO_DAO_SUPPORT
#define _AFX_NO_AFXCMN_SUPPORT

#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC OLE automation classes
#endif // _AFX_NO_OLE_SUPPORT

#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT

#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

When I commented out #define _AFX_NO_AFXCMN_SUPPORT the errors disappeared.

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top