-
August 11th, 2010, 04:35 PM
#1
Compilation Issues 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\serviceconfigurationmanager\serviceconfigurationmanagermodule.h(32): error C2504: 'CAtlServiceModuleT' : base class undefined
c:\work\main\actra5.x\projects\serviceconfigurationmanager\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)
Do you have any suggestions on how to fix this problem? Unfortunately, I cannot provide the project since it was written internally by my company.
-
August 12th, 2010, 01:36 AM
#2
Re: Compilation Issues with VS2010
CAtlServiceModuleT is defined inside a namespace called ATL. Did you take that into consideration?
-
August 12th, 2010, 05:41 AM
#3
Re: Compilation Issues with VS2010
Originally Posted by cilu
CAtlServiceModuleT is defined inside a namespace called ATL. Did you take that into consideration?
What means you either need to have
class CServiceConfigurationManagerModule : public ATL::CAtlServiceModuleT, ...
or use a using clause before (less recommended).
BTW, in my opinion you can't use a template type for the baseclass CAtlServiceModuleT which isn't yet defined. How should that work that a baseclass has its own derived class as template type?
Regards, Alex
-
August 12th, 2010, 06:34 AM
#4
Re: Compilation Issues with VS2010
BTW, in my opinion you can't use a template type for the baseclass CAtlServiceModuleT which isn't yet defined. How should that work that a baseclass has its own derived class as template type?
It works. ATL uses that intensively. Here you can read more about this pattern: http://en.wikipedia.org/wiki/Curious...mplate_pattern.
Last edited by cilu; August 12th, 2010 at 06:40 AM.
-
August 12th, 2010, 09:45 AM
#5
Re: Compilation Issues with VS2010
Yes, I've taken into consideration that CAtlServiceModuleT is defined under ATL. In my stdafx.h, I have a line saying using namespace ATL. Please do note that this project was compiling in earlier versions of Visual Studio 2010.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|