gpt4 book ai didi

c++ - windows.h 之间的区别stdafx.h

转载 作者:行者123 更新时间:2023-11-30 16:15:35 26 4
gpt4 key购买 nike

我尝试学习如何创建.DLL动态链接库,我读的书不是最新的,它讲述了如何为Windows制作.DLL 32 位。我用的是VS 2017 PRO,书上是用VS 2013来叙述的。

书中SC是这样开始的

// Dll1.cpp : Defines the exported functions for the DLL application.
//

#include windows.h

当我尝试适应VS 2017 PRO时,我的项目是一个.DLL动态链接库EMPTY,所以它看起来像这样。

// Dll1.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"

这两个** HEADERS **(标题)有什么区别

  • windows.h
  • stdafx.h

最佳答案

What is the difference between these two ** HEADERS ** (headers)

  • windows.h
  • stdafx.h

一切。事实上,这就像你在问汽车说明书和麦片棒的区别一样。

标题 "Windows.h"

Contains the declarations of all library functions Windows API, all the macros used by the programmers of applications for Windows, and all the data structures used in a large number of functions and subsystems.

从广义上讲,它是您的程序与 Windows 操作系统进行通信所需的 header 。

标题“stdafx.h”

由于 C++ 和 C 语言的程序编译速度非常慢1,一些编译器使用一些技巧来加快编译时间,其中的技巧之一就是预编译头

A header that is compiled to an intermediate form that is faster to process by the compiler. The use of pre-compiled headers can significantly reduce compile time, especially when applied to large headers or headers that include other headers.

从广义上讲,它是您在程序中使用的所有 header 都将被预编译到的 header 。

关于c++ - windows.h 之间的区别stdafx.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57031028/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com