用VS2008建立一个DLL项目,一开始的时候不想用MFC, 所以选择的是使用标准Windows库。

使用了一段时间后又想用MFC了,所以把选项改成使用在共享 DLL 中使用 MFC。

但是编译的时候报错:

fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

看看那么多的文件没有头绪。

【解决方法】

在项目属性中,设置显示包含为是。

再次编译的时候,输出窗口中会给出详细的提示,这样就能够看到到底是哪个文件导致的。

根据报错的文件,发现有如下包含的头文件:

#include
"StdAfx.h"

#include
"afxinet.h"

#include
"HttpHelper.h"

 

将#include
"afxinet.h" 放到最前面就可以了。

MFC apps must not include windows.h的更多相关文章

  1. fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

    给对话框添加类, 报错 CalibrateMFCDlg.h(6) : error C2504: “CDialog”: 未定义基类 等多个错误 加上 #include "afxwin.h&qu ...

  2. MFC项目中包含atlimage.h导致fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

    因为要用到CImage所以包含了atlimage.h 报这个错误的话你只需要把atlimage.h放在afxwin.h的下方即可,不能让它在afxwin.h的上方

  3. #include <windows.h>

      1 FindWindowA 2 keybd_event 3 malloc 4 MessageBox 5 MessageBoxA 6 MessageBoxW 7 mouse_event 8 SetC ...

  4. vs2017自动生成的#include“stdafx.h”详解及解决方案

    vs2017自动生成的#include“stdafx.h”详解及解决方案 问题描述: 在高版本的Visual Studio的默认设置中,会出现这么一个现象,在新建项目之后,项目会自动生成#includ ...

  5. c++中的#include "stdafx.h"

    转自:https://blog.csdn.net/lijun5635/article/details/13090341 在网上看到的一篇很详细的文章解释,之前一直不明白这个头文件什么作用,用来学习很好 ...

  6. #include<unistd.h>存在linux中,含有系统服务的函数

    #include<unistd.h> linux标准库#include <unistd.h>与windows的#include <windows.h>(C语言开发) ...

  7. #include <process.h>

    1 _beginthread 单进程,单线程,必须干完一件事情后干另一件事情 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #incl ...

  8. #include <time.h>

    1 _strtime 2 difftime 3 srand 4 time 1 _strtime 函数简介 函数名: _strtime 头文件: time.h 函数原型: char * _strtime ...

  9. windows.h与winsock2.h的包含顺序

    #define WIN32_LEAN_AND_MEAN #include <windows.h>

随机推荐

  1. android 视频 2017

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha

  2. POJ2104 K-th Number 不带修改的主席树 线段树

    http://poj.org/problem?id=2104 给定一个序列,求区间第k小 通过构建可持久化的点,得到线段树左儿子和右儿子的前缀和(前缀是这个序列从左到右意义上的),然后是一个二分的ge ...

  3. SPOJ QTREE

    QTREE /* 题目大意:维护一棵树,允许修改边权以及查询链上最大值 题解:我们将边权转为点权,标记在深度较深的点上,树链剖分后用线段树处理即可 */ #include <cstdio> ...

  4. Jmeter+JDK的安装学习笔记

    第一步:首先从jmeter的官网下载jmeter,目前最新版本为3.3,支持的JDK最高为1.8 下载地址: jmeter:http://jmeter.apache.org/download_jmet ...

  5. 电感式升压转换器-AIC1896 电感式升压转换器

    电感式升压转换器-AIC1896 AIC1896是一个脉冲宽度调变(Pulse-Width-Modulation;PWM)控制之升压型转换器,它可以提供一个定电流以驱动白光LED. (图五A)为升压转 ...

  6. js单例模式详解实例

    这篇文章主要介绍了什么是单例单例模式.使用场景,提供了3个示例给大家参考 什么是单例? 单例要求一个类有且只有一个实例,提供一个全局的访问点.因此它要绕过常规的控制器,使其只能有一个实例,供使用者使用 ...

  7. nyoj 164&amp;&amp;poj2084 Game of Connections 【卡特兰】

    题意:将1~2n个数依照顺时针排列好.用一条线将两个数字连接起来要求:线之间不能有交点.同一个点仅仅同意被连一次. 最后问给出一个n,有多少种方式满足条件. 分析: ans[n]表示n的中的种类数. ...

  8. C#监控文件夹变化

    当需要监控某一文件,FileSystemWatcher类提供了Created, Deleted,Rename等事件. 就拿FileSystemWatcher的Created事件来说,该事件类型是Fil ...

  9. Redis持久化RDB和AOF优缺点是什么,怎么实现的?我应该用哪一个?

    原文http://www.ymq.io/2018/03/24/redis/ Redis是一种高级key-value数据库.数据可以持久化,而且支持的数据类型很丰富.有字符串,链表,集 合和有序集合.支 ...

  10. Writable atomic property '***' cannot pair a synthesized setter/getter with a user defined

    1. warning: Semantic Issue: Writable atomic property 'number' cannot pair a synthesized setter/gette ...