Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a dll?

Tags:

dll

People also ask

What does a .DLL file do?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Each program can use the functionality that is contained in this DLL to implement an Open dialog box.

What is DLL in simple words?

Stands for "Dynamic Link Library." A DLL (. dll) file contains a library of functions and other information that can be accessed by a Windows program. When a program is launched, links to the necessary . dll files are created.

What is the difference between an EXE and a DLL?

EXE is an extension used for executable files while DLL is the extension for a dynamic link library. 2.An EXE file can be run independently while a DLL is used by other applications. 3. A DLL file can be reused by other applications while an EXE cannot.

What is a DLL file and how do I open it?

Dynamic Link Library (DLL) files aren't average text files that can be opened in an editor—they contain compiled code and objects that Windows programs reference during use. If you want to see or edit the code that makes a DLL file work, you can easily do so using a decompiler.


A DLL is a dynamic link library. It is a collection of code and/or data, which may be used by several applications (or other libraries/modules).

So for instance common methods to process files, work with GUI components etc. are made available in libraries so several applications may use the same functionality. This not only reduces the need to build the same stuff multiple times, but it also ensures that e.g. common dialogs are the same between applications.

Libraries can be loaded at runtime and thus shared between different concurrent applications. This is called dynamic linking.

In some cases the library can be included within the application itself. This is known as static linking. Static linking makes deployment easier at the cost of flexibility as different application will each load the same copy of the DLL.

However, static linking is not always an option. E.g. you can't statically link a .NET application. The user must have the .NET libraries in order to run a .NET application and libraries (or assemblies as they are called in .NET) are loaded at runtime.

DLLs are created by the same tools used to create applications. The specific details depend very much on the tools used.


DLL = Dynamic Link Library

The name is actually quite descriptive of what they accomplish.

Library

Lets you isolate code for a specific problem domain into a single location. Then share this among multiple applications. The library can be swapped out for another at any time to fix bugs or add functionality.

Link

You can "Link" the library to an application so that the logic in the library is not compiled directly into the application.

Dynamic

The library can be loaded on-demand. Instead of loading a mammoth single EXE into memory, the OS can load only the portions needed. Plus if a DLL is shared between applications, the OS can optimize how the library is loaded and share it between apps.


DLL (dynamic link library) files can be described as small "sub-programs" which are meant to help a bigger program run well. They provide a means of linking various hardware and software resources (at various points in its run-time sessions) to the main executable program upon which they are based, on an "as-the-need-arises" basis. This eliminates the need to load everything to do with the main executable program onto the computer's RAM (random access memory) when the program is first ran.

The software resources carried by DLLs include code for the various program functions that aren't really needed to keep the program running: that is, functions that only need to be called upon at certain times during a given computing session and might actually not even need to be called at all. Loading those functions (and there can be a considerable number of them for a given program) onto the computer's RAM when the program is first ran and then keeping them there throughout the session would be a waste of RAM space - which is considered to be at a premium.

A major advancement:

The development of DLLs was a major advancement in computing, because before they were available, everything to do with a program (including functions that were rarely if ever used) had to be loaded onto the RAM when the program was first loaded. That led to extremely inefficient computing, with slower speeds exhibited by various programs. It was also extremely hard to multitask by running even a couple of simple programs, because of the attendant strain on the RAM.

Considerations:

DLLs are usually version-specific. Those that work well for, say, Version 1 of a program (or a programming language, as may be the case) might not work well with Version 2. The general rule is that the DLLs in the older version tend to be unable to work well with the newer version, but those of the newer version can generally work quite well with the older version of the program or programming language.


Dynamically Linked Library.

To give you an example, If you have someone else's DLL loaded into you application you can use bits of programming from it.

You can load a DLL that generates random numbers that always start with "5" or something.

In you program you can call CrazyDLL.GenerateRandomNumbersSorta() and it will return the number.

For a real world example, I have DLL that combines 4 textboxes (you'd use these to type IP addresses) and it automatically only accepts numbers less than 256, and handles pressing the backspace key to jump to a previous textbox.

I've created a DLL with that code, and now all I have to do is drag and drop more of those IP address textbox collections without having to duplicate all that code over and over again.

The same DLL also has function for converting IP addresses to hexadecimal strings, and other useful code.


From MSDN Library:

A dynamic-link library (DLL) is a module that contain functions and data that can be used by another module (application or DLL).


DLL = Dynamic Load Link Library. As you have been told, it is basically a collection of functions, C++ classes, and/or global variables. You can load the DLL statically (i.e. the OS loads it automatically when your program starts) or dynamically (your program explicitly loads it), at which point the functions and stuff inside the DLL are available to your program.

Creating one is similar to creating an EXE, except there doesn't need to be a main() function. There are linker directives to tell the linker to create a DLL rather than an EXE.

The main reason you'd want to do this is to encapsulate some code in one place and use it from multiple exe's, rather than linking the code into each one.

A somewhat historical reason is that your exe can be smaller since some of the code is physically located in a different file. This means that the amount of space taken up in memory by your exe can be smaller. On modern systems, this is less of an issue than it used to be, though it still might be an issue on Windows Mobile.