How to fix the given compilation issue with VS2010?

I am facing issues with a project called ServiceConfigurationManager in Visual Studio 2010. The project compiles without a hitch in Visual Studio 2005, it also compiles perfectly if I change the Platform Toolset to v90 in the Property Pages. The project is an EXE which uses both ATL and MFC.

When I try to execute the following line of code in a file called ServiceConfugrationManagerModule.h:

class CServiceConfigurationManagerModule
: public CAtlServiceModuleT <CServiceConfigurationManagerModule, IDS_SERVICENAME>, public CWindowImpl<CServiceConfigurationManagerModule>
{

I'm met with a barrage of errors, the most important of which is:

c:\work\main\actra5.x\projects\serviceconfiguratio nmanager\serviceconfigurationmanagermodule.h(32): error C2504: 'CAtlServiceModuleT' : base class undefined

c:\work\main\actra5.x\projects\serviceconfiguratio nmanager\serviceconfigurationmanagermodule.h(32): error C2143: syntax error : missing ',' before '<'


Note that CAtlServiceModuleT is defined in atlbase.h. I am not entirely sure of the problem, but I suspect that somehow a macro called _ATL_NO_SERVICE is incorrectly defined due to some setting. In atlbase.h, CAtlServiceModuleT is defined following the statement '#ifndef _ATL_NO_SERVICE'. (Note that atlbase.h is included in my stdafx.h, which in turn is included in ServiceConfigurationModule.h)

Also, I'm aware that CAtlServiceModuleT is defined under the namespace ATL.

Does anyone have any suggestions on how to fix this problem? Unfortunately, I cannot provide the project since it was written internally by my company.
So have you put in a using namespace ATL directive then??

or as you are talking about a header file - you may not want to do a using namespace directive and pollute the global namespace.
So have you tried:

1
2
3
class CServiceConfigurationManagerModule
: public ATL::CAtlServiceModuleT <CServiceConfigurationManagerModule, IDS_SERVICENAME>, public CWindowImpl<CServiceConfigurationManagerModule>
{
Last edited on
@guestgulkan: Thanks a lot. Your suggestion fixed the problem. I previously had a 'using namespace ATL'.
Topic archived. No new replies allowed.