我想在一个控制台程序中加入MFC类,编译时总是报MFC程序不能包含windows.h
哪个控制台程序已写好了,且必须要包含windows.h,请问怎么做。

解决方案 »

  1.   

    当然可以 #include <afx.h> 
    不过记得要在project settings -> c/c++ 中设置多线程编译
      

  2.   

    : flyelf(空谷清音) ( ) 对
      

  3.   

    都试过了,加afx.h时就出现MFC不能包含windows.h错误。
    我已设置了多线程,及使用using MFC as a shall dll.
      

  4.   

    1、加 #include <afx.h> 
    2、记得要在project settings -> general中设置Use MFC 我试过可以的。
      

  5.   

    都试过了,加afx.h时就出现MFC不能包含windows.h错误。
    我已设置了多线程,及使用using MFC as a shall dll.
    --------
    去掉你的工程中 #include <windows.h>