Difference between .dll and .exe?

后端 未结 15 1197
有刺的猬
有刺的猬 2020-12-02 04:23

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

15条回答
  •  青春惊慌失措
    2020-12-02 04:53

    This answer was a little more detailed than I thought but read it through.

    DLL:
    In most cases, a DLL file is a library. There are a couple of types of libraries, dynamic and static - read about the difference. DLL stands for dynamic link library which tells us that it's a part of the program but not the whole thing. It's made of reusable software components (library) which you could use for more than a single program. Bear in mind that it's always possible to use the library source code in many applications using copy-paste, but the idea of a DLL/Static Library is that you could update the code of a library and at the same time update all the applications using it - without compiling.

    For example:
    Imagine you're creating a Windows GUI component like a Button. In most cases you'd want to re-use the code you've written because it's a complex but a common component - You want many applications to use it but you don't want to give them the source code You can't copy-paste the code for the button in every program, so you decide you want to create a DL-Library (DLL).

    This "button" library is required by EXEcutables to run, and without it they will not run because they don't know how to create the button, only how to talk to it.

    Likewise, a DLL cannot be executed - run, because it's only a part of the program but doesn't have the information required to create a "process".

    EXE:
    An executable is the program. It knows how to create a process and how to talk to the DLL. It needs the DLL to create a button, and without it the application doesn't run - ERROR.

    hope this helps....

提交回复
热议问题