ATL project for WM2005

Greetings,

I try to move ATL project (VS2005) from WM2003 to WM2005.

Compiler gives out following errors:

C: \Program Files \Microsoft Visual Studio 8 \VC \ce \atlmfc \include \atlcommem.h (71): error C2039: ' CoTaskMemSize ': is not a member of ' ` global namespace "

C: \Program Files \Microsoft Visual Studio 8 \VC \ce \atlmfc \include \atlcommem.h (71): error C3861: ' CoTaskMemSize ': identifier not found

 

I used  #define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA without success

There are what ideas



Answer this question

ATL project for WM2005

  • ron nash

    Thanks still time for the answer,

    In my opinion all problem consists in use CAppModule from WTL

    As this class is inherited from CComModule.

    In <atlcommem.h> the following is certain:

    #if (_WIN32_WCE <0x0500)

    WINOLEAPI_ (UINT) CoTaskMemSize (LPVOID pv);

    #endif // (_WIN32_WCE <0x0500)

    How it should be understood


  • Anand Raman - MSFT

    Hi,
    The declaration in atlcommem.h is more of a workaround than anything else. This is needed for CE versions less than 5.0 due to a bug in the SDK headers.

    It shouldn't be needed for CE version 5.0 and higher as the method is declared in objbase.h SDK header. This gets included by the default wizard generated MFC/ATL projects.

    Can you please try including this SDK header

    Thanks,
    Avinash


  • DmitryKo

    I have opened a bug to track the same for next VS release. (devdiv bugs 86445)
  • boran_blok_edan

    Include the AtlCtl.h or AtlWin.h in your stdafx.h file and rebuild, that should get rid of compilation errors.

    Thanks,

    Gangadhar Heralgi


  • Boris Zakharin

    Surely from the code point this looks like a bug, However I am not able to hit the specific error, it would be great if you can open a bug on MSDN product feedback center with exact steps to repro.

    As I suspect it may also have to do with the way you are passing your preprocessor options that is enabling inclusion of atlcommem.h file, can you pass on your command line options to the compiler, with the repro steps.

    II think we can suggest a workaround if we could hit the problem with a sample repro, you can send a sample repro to me, my id is - gheralgi AT microsoft DOT com

    Thanks,

    Gangadhar Heralgi


  • Taylor Meek

    Thanks for your answer,

    So When I create simple ATL exe WM2005 project without include atlCtl.h and atlWin.h, it builds ok.

    Including thoses files raises compilation errors.
    This is my stdafx.h file

    #pragma once

    //added by myself

    #define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA

    #pragma comment(linker, "/nodefaultlib:libc.lib")

    #pragma comment(linker, "/nodefaultlib:libcd.lib")

    #ifndef STRICT

    #define STRICT

    #endif

    #include <ceconfig.h>

    #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)

    #define SHELL_AYGSHELL

    #endif

    // NOTE - this is value is not strongly correlated to the Windows CE OS version being targeted

    #define WINVER _WIN32_WCE

    #ifdef _CE_DCOM

    #define _ATL_APARTMENT_THREADED

    #endif

    #define _ATL_NO_AUTOMATIC_NAMESPACE

    #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit

    #include "resourceppc.h"

    #include <atlbase.h>

    #include <atlcom.h>

    //#include <atlapp.h>

    #include <AtlCtl.h >

    //#include <atlwin.h>

    //extern CAppModule _Module;

    #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)

    #ifndef _DEVICE_RESOLUTION_AWARE

    #define _DEVICE_RESOLUTION_AWARE

    #endif

    #endif

    #ifdef _DEVICE_RESOLUTION_AWARE

    #include "DeviceResolutionAware.h"

    #endif

    using namespace ATL;

    #include <aygshell.h>

    #pragma comment(lib, "aygshell.lib")

    #if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) )

    #pragma comment(lib, "ccrtrtti.lib")

    #ifdef _X86_

    #if defined(_DEBUG)

    #pragma comment(lib, "libcmtx86d.lib")

    #else

    #pragma comment(lib, "libcmtx86.lib")

    #endif

    #endif

    #endif

    #include <altcecrt.h>


  • Dr.Virusi

    I guess the problem is in this line

    #if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) )

    #pragma comment(lib, "ccrtrtti.lib")

    #ifdef _X86_

    #if defined(_DEBUG)

    #pragma comment(lib, "libcmtx86d.lib")

    #else

    #pragma comment(lib, "libcmtx86.lib")

    #endif

    #endif

    #endif

    Look at the disabled line in my case, in your case entire stuff below #if _WIN32_WCE < 0x500 && ( defined .... is disabled, Can you please check your build logs - also it would be use ful if you can send me exact steps to reproduce the problem, I would be able to help you.

    Thanks,

    Gangadhar Heralgi


  • ATL project for WM2005