Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Visual-Studio MFC ATL
I am facing issues with a project called ServiceConfigurationManager, using Visual Studio 2010. To be more specific, when I try to execute the following line of code in a file called ServiceConfugrationManagerModule.h:
 
class CServiceConfigurationManagerModule
    : public CAtlServiceModuleT <cserviceconfigurationmanagermodule,>, public CWindowImpl<cserviceconfigurationmanagermodule>
{</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 '<'
 

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 settings. 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)
 
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.
 
Does anyone have any suggestions on how to fix this problem? Unfortunately, I cannot provide the entire code since it was written internally by my company.
Posted 11-Aug-10 12:22pm
Edited 12-Aug-10 12:23pm
v2
Comments
GPUToaster at 12-Aug-10 5:30am
   
Try finding out the 2010 header file. See its declaration and how to use it. May be the declarations have changed in 2010. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Did you know that you need to resetup your include directories, etc?
Visual Studio 2010 is nice enough to remove all of your global directories for all of your projects and you have to reset them up manually. I suggest that you use environment variables... I did it the hard way the first time and then found out that you can use LIB and INCLUDE environment variables.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

There is a context menu item "Go To Definition" in a source view of a Studio.
Use it in your opened solution for _ATL_NO_SERVICE Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Original VS2008/VS2005 Source in stdafx.h compiles just fine but will not compile on VS2010 with same error.
error C2504: 'CAtlServiceModuleT' : base class undefined
 
#include <afx.h>
#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
    #include <afxdtctl.h>       // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
 
#undef _AFX
#undef _ATL_NO_SERVICE
 
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
 
Updated VS2010 Source in stdafx.h compiles just fine. Trick is to swap AFX and ATL order and add #undef _WINDOWS_ before including the MFC headers did the trick for me.
#undef _ATL_NO_SERVICE
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
#undef _WINDOWS_
 
#include <afx.h>
#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
    #include <afxdtctl.h>       // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
 
#undef _AFX
  Permalink  
v2
Comments
SoMad at 24-Jun-12 0:39am
   
The question is 2 years old, he has probably been able to get it working since then.
 
Soren Madsen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100