Question:
What are .dll files and how to use them?
godman03
2006-04-19 22:56:54 UTC
What are .dll files and how to use them?
Nine answers:
OneRunningMan
2006-04-20 11:21:04 UTC
“Some operating systems can only link in a library at loadtime, before the process starts executing; others may be able to wait until after the process has started to execute and link in the library just when it is actually referenced (i.e. during runtime). The latter is often called "delay loading". In either case, the library is called a dynamically linked library. This term is sometimes shortened to "dynamic link library" or DLL, but this last initialism is most common in Microsoft Windows environments where dynamic libraries use the filename extension .dll. See DLL.



Dynamically linked libraries date back to at least MTS (the Michigan Terminal System), built in the late 1960s. ("A History of MTS", Information Technology Digest, Vol. 5, No. 5)



Relocation

One wrinkle that the loader must handle is that the location in memory of the actual library data is not knowable until after the executable and all dynamically linked libraries have been loaded into memory, since the memory locations used depend on which specific DLLs have been loaded. It is not possible to store the absolute location of the data in the executable, nor even in the DLL.



It would theoretically be possible to examine the program at load time and replace all references to data in the libraries with pointers to the appropriate memory locations once all DLLs have been loaded, but this method would consume unacceptable amounts of either time or memory. Instead, most dynamic library systems link a symbol table with blank addresses into the program at compile time. All references to code or data in the library pass through this table, the import directory. At load time the table is modified with the location of the library code/data by the loader/linker.



The library itself contains a table of all the methods within it, known as entry points. Calls into the library "jump through" this table, looking up the location of the code in memory, then calling it. This introduces overhead in calling into the library, but the delay is usually so small as to be negligible.



Locating libraries at runtime

Dynamic linkers/loaders vary widely in functionality. Some depend on explicit paths to the libraries being stored in the executable. Any change to the library naming or layout of the filesystem will cause these systems to fail. More commonly, only the name of the library (and not the path) is stored in the executable, with the operating system supplying a system to find the library on-disk based on some algorithm.



Most Unix-like systems have a "search path" specifying file system directories in which to look for dynamic libraries. On some systems, the default path is specified in a configuration file; in others, it's wired into the dynamic loader. Some executable file formats can specify additional directories in which to search for libraries for a particular program. It can usually be overridden with an environment variable, although that's disabled for setuid and setgid programs, so that a user can't force such a program to run arbitrary code. Developers of libraries are encouraged to place their dynamic libraries in places in the default search path. On the downside this can make installation of new libraries problematic, and these "known" locations quickly become home to an increasing number of library files, making management more complex.

Microsoft Windows will check the registry to determine the proper place to find an ActiveX DLL, but for standard DLLs it will check the current working directory; the directory set by SetDllDirectory(); the System32, System, and Windows directories; and finally the PATH environment variable.

OpenStep used a more flexible system, collecting up a list of libraries from a number of known locations (similar to the PATH concept) when the system first starts. Moving libraries around causes no problems at all, although there is a time cost when first starting the system.

One of the largest disadvantages of dynamic linking is that the executables depend on the separately stored libraries in order to function properly. If the library is deleted, moved, or renamed, or if an incompatible version of the DLL is copied to a place that is earlier in the search, the executable could malfunction or even fail to load. On Windows this is commonly known as DLL hell.”
Waheed
2006-04-19 23:03:36 UTC
Dll files are used as follows:



1)

Dynamic Link Library



A .DLL file is a support file and is used by one or more programs. As an example, if several parts of a program need to perform the same action that action may be placed into a .DLL file (library) that the various program parts can all use. This saves space and makes it easier when that particular routine needs to be updated. You should never have a need to "open" a .DLL file on its own; indeed, there really is no way to do so. Note: This file type can become infected and should be carefully scanned if someone sends you a file with this extension. If you want to look at the resources in a DLL library you can use a program like PE Resource Explorer but BE CAREFUL as messing with a DLL file can seriously damage Windows or programs if you do the wrong thing.



Various programs use this extension; too many to list individually. Take clues from the location of the file as a possible pointer to exactly which program is producing the file. The file's date and time can also help if you know which programs you were running when the file was written.



2)

CorelDraw Export/Import Filter



It was submitted to the list and appeared to be accurate; however, no verification links have so far been found on the Internet.
draciron
2006-04-19 23:03:36 UTC
DLLs are dynamic link libraries. What this means in non-techie is that they provied services to programs you run. A DLL can be used by multiple programs. For example most internet software run under windows uses the same dlls. This means that the person writing the code does not have to write everything from scratch.



Unless you are a programmer you do not use them directly. They are used by applications that you run. My email is public, if you need furthor advice on this just send me a note.
ronjj
2006-04-19 23:03:20 UTC
DLL stand for "Dynamic Link Library". If you've made activeX applications or controls, it's very similar. You make a control with all the functions you want. The control is part of a project with a "main" executable, which you use to test your control. After all the functions work properly, you remove the "main" and compile as a DLL. You'll have to check with your compiler to see if it has that option.
DogmaBites
2006-04-19 23:04:48 UTC
Dll is short for Dynamic Link Library. They contain executable code, data, UI resources or any combination thereof.



Other programs can load them and retrieve address of exported functions and data at runtime. This allows a number of benefits. For example, different programs can share libraries of code avoiding duplication of code in each program file. It allows updating of different modules without having to relink the entire executable. It allows programs to have optional "plug-in" style behavior. It also allows behavior to be changed by replacing a file with a different version.



Unix/Linux has the same concept in .so files
mohammad Taheri
2006-04-19 23:12:49 UTC
dll is library of functions and procedures that can be used by programs. you can use them with one of the IDE(Intgrated Development Enviroment) like Visual Studio,Delphi and so
talatian
2006-04-19 23:06:38 UTC
(Computers) file containing the executable routines of a program (in the operating systems Windows and OS/2) .

it can be created by "visual basic" "visual c++" "delphi"

or ...

for example you created dll file that get or set time and date by "visual basic" . after that you can use that file for every program need to have function for set and get time,date
Know it all (almost)
2006-04-19 22:59:14 UTC
They are dynamic libraries loaded at runtime. You an use rundll or rundll32 to use them. If you want to use them in your programs you have to get the sdk with all of the header files.
on_vacation
2006-04-20 00:19:27 UTC
dynamic link library


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...