偶在ATL(没选MFC支持)的项目里想用COleDateTime,按照msdn上的说法 
在头文件中#include <afxdisp.h>,但编译提示g:\program files\microsoft 
visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: 
#error :  WINDOWS.H already included.  MFC apps must not #include <windows.h> 
这是咋回事,请大家指点,3X!

解决方案 »

  1.   

    maybe you can use some other class to take place of COleDataTime
    http://www.codeguru.com/atl/DateLib.shtml
      

  2.   

    1、打开你的工程中StdAfx.h文件
    2、加入#include <afxtmepl.h>语句于#include <atlbase.h>前,形如以下:
    #include <afxtempl.h>  //手工添加
    #include <atlbase.h>   //向导生成此时你的ATL组件就支持MFC了。快试一下吧!
      

  3.   

    bager兄,按你的方法,出现如下错误,如何解决?
    Linking...
    mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in AERTDB.obj
    mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in AERTDB.obj; second definition ignored
       Creating library Debug/AERTDB.lib and object Debug/AERTDB.exp
    Debug/AERTDB.dll : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.