CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Posts
    2

    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.

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Compilation Issues with VS2010

    CAtlServiceModuleT is defined inside a namespace called ATL. Did you take that into consideration?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: Compilation Issues with VS2010

    Quote Originally Posted by cilu View Post
    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

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  5. #5
    Join Date
    Aug 2010
    Posts
    2

    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
  •  





Click Here to Expand Forum to Full Width

Featured