• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
DLLS

A dynamic-link library (DLL) is an executable file that acts as a shared library of functions. Dynamic
linking provides a way for a process to call a function that is not part of its executable code. The
executable code for the function is located in a DLL, which contains one or more functions that are
compiled, linked, and stored separately from the processes that use them. DLLs also facilitate the
sharing of data and resources. Multiple applications can simultaneously access the contents of a single
copy of a DLL in memory.

Dynamic linking differs from static linking in that it allows an executable module (either a .dll or .exe
file) to include only the information needed at run time to locate the executable code for a DLL
function. In static linking, the linker gets all of the referenced functions from the static link library and
places it with your code into your executable.

Using dynamic linking instead of static linking offers several advantages. DLLs save memory, reduce
swapping, save disk space, upgrade easier, provide after-market support, provide a mechanism to
extend the MFC library classes, support multilanguage programs, and ease the creation of international
versions.

This article family provides detailed information on programming DLLs.
Differences Between Applications and DLLs

Even though DLLs and applications are both executable program modules, they differ in several ways.
To the end-user, the most obvious difference is that DLLs are not programs that can be directly
executed. From the system's point of view, there are two fundamental differences between applications
and DLLs:

An application can have multiple instances of itself running in the system simultaneously, whereas a
DLL can have only one instance.
An application can own things such as a stack, global memory, file handles, and a message queue, but a
DLL cannot.
Advantages of Using DLLs
Dynamic linking has the following advantages:
\ue000Saves memory and reduces swapping. Many processes can use a single DLL simultaneously,
sharing a single copy of the DLL in memory. In contrast, Windows must load a copy of the
library code into memory for each application that is built with a static link library.
\ue000Saves disk space. Many applications can share a single copy of the DLL on disk. In contrast,
each application built with a static link library has the library code linked into its executable
image as a separate copy.
\ue000Upgrades to the DLL are easier. When the functions in a DLL change, the applications that use

them do not need to be recompiled or relinked as long as the functions' arguments and return values do not change. In contrast, statically linked object code requires that the application be relinked when the functions change.

\ue000Provides after-market support. For example, a display driver DLL can be modified to support a
display that was not available when the application was shipped.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...