将atltime标头包含在WTL项目中时出错

时间:2012-12-03 18:48:20

标签: c++ atl wtl

使用WTL中的对话框向导创建了一个简单的对话框 - Visual Studio 9后,我添加了<atltime.h>标题,我得到了这个:

Error   2   error C2039: 'CString' : is not a member of 'WTL'   ...\wtl\include\atlctrls.h  5060    TASKSCHEDULER
Error   3   error C2039: 'CString' : is not a member of 'WTL'   ...\wtl\include\atlctrls.h  969 TASKSCHEDULER
Error   4   error C2039: 'CString' : is not a member of 'WTL'   ...\wtl\include\atldlgs.h   535 TASKSCHEDULER
Error   5   error C2039: 'CString' : is not a member of 'WTL'   ...\wtl\include\atldlgs.h   627 TASKSCHEDULER
Error   6   error C2039: 'CString' : is not a member of 'WTL'   ...\wtl\include\atldlgs.h

697 TASKSCHEDULER

1 个答案:

答案 0 :(得分:3)

我遇到了类似的情况,有两件事帮我摆脱了错误,可能对别人有帮助。

  1. atlstr.h
  2. 之上加atlapp.h
  3. 定义_WTL_NO_CSTRING