在如下语句出现问题。错误提示是:error C2039: 'CSize' : is not a member of 'WTL'
_WTYPES_NS::CSize GetScrollSize()
{
return m_sizeTrue;
}CSize 是在C:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include 这个路径下的某个头文件定义的。于是,我就把此路径加到了vs的选项中的路径下了。可是重新编译后还是有这个错误,请问是什么原因?

解决方案 »

  1.   

    是WTL的atlmisc.h中的CSize与VS自带的atltypes.h中的CSize冲突了
      

  2.   

    在stdafx.h中
    #define _WTL_NO_WTYPES
    #incluce <atlmisc.h>
      

  3.   

    那你stdafx.h中有
    #include <atltypes.h>没?
      

  4.   


    应该是你加的顺序不对,你仔细看下。
    原因就是没定义或冲突。如果还不行把你stdafx.h贴上来看看。
      

  5.   

    贴上来了,如下,文件stdafx.h
    #define USEMARTPOINTER 0
    #define WINVER 0x0420
    #define _SECURE_ATL 1
    #define _WIN32_WCE_AYGSHELL 1
    //#define _WTL_NO_CSTRING
    #include <atlbase.h>
    #include <atlapp.h>//#include <atltypes.h> #define _WTL_NO_WTYPES
    #include <atlmisc.h> 
    #include <atlimage.h>extern CAppModule _Module;#if defined( DEBUG) && !defined( _DEBUG)
    #define _DEBUG
    #endif
    #ifdef _DEBUG
     #define DBGMODE "d"
    #else
     #define DBGMODE ""
    #endif#include <atlwin.h>#include <aygshell.h>
    #pragma comment(lib, "aygshell.lib")#include "SmartPtr.h"
    using namespace Loki;
    #include <gdiplus.h>
    using namespace Gdiplus;
    #pragma comment(lib, "LibGDIPlus" DBGMODE ".lib")
      

  6.   

    #define USEMARTPOINTER 0
    #define WINVER 0x0420
    #define _SECURE_ATL 1
    #define _WIN32_WCE_AYGSHELL 1#include <atlbase.h>
    #define _WTL_NO_CSTRING
    #define _WTL_NO_WTYPES
    #include <atlimage.h> 
    #include <atlapp.h>
    #include <atlmisc.h>extern CAppModule _Module; 
      

  7.   

    这一个帖子已过了四个月了,也正好遇到这一个问题!网上好难找到解决方法,不过自己看了下,在stdafx.h里定义#define __ATLTYPES_H__把atltypes.h屏蔽掉便可以了。如下:#include <atlbase.h>#include <atlapp.h>//#define _WTL_NO_WTYPES
    #define __ATLTYPES_H__
    #include <atlmisc.h> 
    #include <atlimage.h>
    我们很有缘分,我也是编译的GDIPlusCE,也是在mobile下。顺便问下还有分吗?
      

  8.   

    贴一下,我解决这个问题时的头文件
    // Windows Header Files:
    #include <windows.h>// C RunTime Header Files
    #include <stdlib.h>
    #include <malloc.h>
    #include <memory.h>
    #include <tchar.h>#include <atlbase.h>
    #include <atlwin.h>
    #include <atlapp.h>
    #include <atlddx.h>
    #include <atlcrack.h>
    #define __ATLTYPES_H__
    #include <atlmisc.h>  //gdi+ 部分
    #ifndef ULONG_PTR
    #define ULONG_PTR unsigned long*
    #include "GdiPlus.h"
    using namespace Gdiplus;
    #pragma comment(lib, "gdiplus.lib")
    #endif