我在win32程序中加入了对话框,并为对话框添加了类,就出现上面的错误,我把类删除后还是这样的错误,出错的文件是afxv_win32.h

解决方案 »

  1.   

    你不要include<windows.h>啦.....
    MFC已经包含了......你打开afxv_win32.h 把include<windows.h>去掉即可...
      

  2.   

    #include <windows.h>
    看哪个文件有这一句~删掉~
      

  3.   

    可是afxv_win32.h中没有没有包含include<windows.h>文件啊,
    而且我没有创建对话框和类前是好的,创建后就不行了,删除了也不行
      

  4.   

    要用mfc,最好就不要直接用Win32 SDK。
      

  5.   

    我删除掉了,可是又出现如下错误:
    1。testApiS error LNK2019: 无法解析的外部符号 __endthreadex ,该符号在函数 "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z) 中被引用
    2。testApiS error LNK2019: 无法解析的外部符号 __beginthreadex ,该符号在函数 "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z) 中被引用
      

  6.   

    直接在stdafx.h中调用就可以了。其他的地方就不要调用了
      

  7.   

    怎么找到stdafx.h这个文件啊?我的工程里根本没有这个文件啊,提示错误是“:\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>
    Error executing cl.exe.”