Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
518 views
in Technique[技术] by (71.8m points)

windows - Difference between .dll and .exe?

I want to know the exact difference between the dll and exe file.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I don't know why everybody is answering this question in context of .NET. The question was a general one and didn't mention .NET anywhere.

Well, the major differences are:

EXE

  1. An exe always runs in its own address space i.e., It is a separate process.
  2. The purpose of an EXE is to launch a separate application of its own.

DLL

  1. A dll always needs a host exe to run. i.e., it can never run in its own address space.
  2. The purpose of a DLL is to have a collection of methods/classes which can be re-used from some other application.
  3. DLL is Microsoft's implementation of a shared library.

The file format of DLL and exe is essentially the same. Windows recognizes the difference between DLL and EXE through PE Header in the file. For details of PE Header, You can have a look at this Article on MSDN


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...