win32控制台项目中试用mfc,并且还要试用Windows.h。
类文件中
#include <afx.h>
类文件中
#include <afx.h>
#include <wmsdk.h>
main文件中
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "WmvStream.h"
#include <Windows.h>
using namespace std;
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
配置属性->常规->项目默认值->MFC的试用:在共享 DLL 中使用 MFC
配置属性->C/C++->代码生成->运行时库:多线程调试DLL(/MDd)
配置属性->C/C++->预编译头->创建/使用用预编译头:不使用预编译头
将试用afx的类文件中#include <afx.h>改为#include <afxwin.h>即可。注意main文件中的包含顺序!
在Win32控制台项目中尝试使用MFC头文件时,遇到错误提示"fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>"。为了解决这个问题,需要在项目属性中设置MFC的试用为"在共享 DLL 中使用 MFC",并更改运行时库为"多线程调试DLL (/MDd)"。同时,要避免直接包含<windows.h>,在使用MFC的类文件中将#include <afx.h>替换为#include <afxwin.h>,注意包含顺序。

810

被折叠的 条评论
为什么被折叠?



