0

I try to learn how to create a .DLL dynamic link library, the book I read is not current, and it tells how to make a .DLL for windows 32 bits. I use VS 2017 PRO, the book is narrated with VS 2013.

in the book SC starts like this

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

#include windows.h

and when I try to adapt to VS 2017 PRO my project is a .DLL dynamic link library EMPTY so it looks like this.

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

#include "stdafx.h"

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

  • windows.h
  • stdafx.h
  • I believe that `Windows.h` is a Microsoft file that comes with they system, while `stdafx.h` is one that you make yourself. –  Jul 14 '19 at 20:45
  • Possible duplicate of [What is "stdafx.h" used for in Visual Studio?](https://stackoverflow.com/questions/4726155/what-is-stdafx-h-used-for-in-visual-studio) – zett42 Jul 14 '19 at 20:48
  • does not answer my question, that is different from what I asked, it does not even look like what I asked – Blender Blackened Jul 14 '19 at 20:51
  • Actually, with a little searching you should be able to answer the question yourself. – zett42 Jul 14 '19 at 20:52
  • does not explain the difference of the headers, simply touches the subject to point and tells you it is the same, obviously it is not the same if you are mentioning later that you still have to load windows.h, then it is not even an answer simply is based on unfounded or documented beliefs – Blender Blackened Jul 14 '19 at 20:53
  • @BlenderBlackened Chipsters answer is correct. I'm not sure what else you are expecting. – john Jul 14 '19 at 20:54
  • hahahaha what a good joke, if I'm surely here to save time. I generally do not attend this system because of its bad practices, but it is the last island that I visit when I can not find more information – Blender Blackened Jul 14 '19 at 20:54
  • @BlenderBlackened What are you looking for, advice on how to build a DLL? – john Jul 14 '19 at 20:55
  • I think that only 1 of 5 questions have been answered and the other 3 answered by myself, and you tell me to search – Blender Blackened Jul 14 '19 at 20:56

1 Answers1

0

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

  • windows.h
  • stdafx.h

Everything.In fact, it is as if you were asking the difference between the instruction manual of a car and a cereal bar.

The header "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.

Broadly speaking, it is the header needed to communicate your program with the Windows operating system.

The header " stdafx.h "

Since the compilation of programs in C ++ and C language is very slow 1 , some compilers use tricks to speed up compilation times, one of these tricks are the pre-compiled headers

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.

Broadly speaking, it is the header to which all the headers you use in your program will go to be pre-compiled.