[comp.windows.ms] .DLL files under Windows 3.0

GOODWIN@MAINE.BITNET (John A Potelle) (09/13/90)

I know the .dll files are called Dynamic Link Libraries, but what
are they used for ?

spolsky-joel@cs.yale.edu (Joel Spolsky) (09/13/90)

In article <90255.141800GOODWIN@MAINE.BITNET> GOODWIN@MAINE.BITNET (John A Potelle) writes:
>I know the .dll files are called Dynamic Link Libraries, but what
>are they used for ?


They are libraries of subroutines that are linked at runtime instead
of compile time. This way if > 1 running application need the same
subroutines only one copy needs to be in memory.

Joel Spolsky
spolsky@cs.yale.edu                                     Silence = Death

dsampson@x102a.harris-atd.com (sampson david 58163) (09/14/90)

In article <26131@cs.yale.edu> spolsky-joel@cs.yale.edu (Joel Spolsky) writes:


   In article <90255.141800GOODWIN@MAINE.BITNET> GOODWIN@MAINE.BITNET
   (John A Potelle) writes:
   >I know the .dll files are called Dynamic Link Libraries, but what
   >are they used for ?

>>   They are libraries of subroutines that are linked at runtime instead
>>   of compile time. This way if > 1 running application need the same
>>   subroutines only one copy needs to be in memory.

DLLs actually have more utility than this.  As Joel says, you can use
the same code for more than 1 instance of an application at a time.
That way you don't replicate code in memory each time you load an
instance of a program.

DLLs are also useful for managing programs during the development
phase.  If you have a program that is fairly large and consists of
several major components, you can put each component chunk of code in
a seperate DLL (yep, just like an old fashion library).  This also
facilitates code development when you have a team of people working on
one project.  Just define the DLL interface and call back functions
(if any) and you can hide the implementation details from the other
coders on the team and let them work at the interface level.

DLLs are used for creating code that is re-usable.  For example, say
you develop some drawing routines that you put in a DLL.  If you
design your DLL "correctly" you can reuse the DLL if you create a new
program (or a family of programs) that requires drawing routines.  I
think that Micrografix does this with their programs.  After all, why
keep writing code to draw a box on the screen.  Use a DLL and the same
implementation works for every application you design.

As we've seen with programs like Screen Peace, a core program can be
written to access DLLs via some defined method (i.e. interface).
Third party developers can then provide the DLL to hook into the
"core" program.  I remember reading that it is possible for 3rd party
developers to write DLLs for us Windows programmers (like all other
3rd party libraries) but I haven't seen any yet.  Hummmm, now maybe
there's a market to look into.....

Lastly, you can store resources in DLLs.  The icon draw program that
being circulated on BBSs, stores icons in it's DLL.  I believe the
Petzold book said that you could also store menus, bitmaps, and other
resources in a DLL.  Obviously, whether you want to do that is a
different question and subject to what you're designing.




--

                    V
                     '
                      '
                       '
                        '
                         ' 
                          *
                          I           Damn Pigeons!




David Sampson                                         Harris Corporation
dsampson@x102a.ess.harris.com                   Gov't Aerospace Systems Divison
uunet!x102a!dsampson                                  Melbourne, Florida

-------------------------------------------------------------------------------

kensy@microsoft.UUCP (Ken SYKES) (09/14/90)

In article <90255.141800GOODWIN@MAINE.BITNET> GOODWIN@MAINE.BITNET (John A Potelle) writes:
>I know the .dll files are called Dynamic Link Libraries, but what
>are they used for ?


In a DOS program all functions that are external to the program are bound
at link time.  This implies that every .exe that uses a function will have
a copy of it in their .exe.  This is rather wateful.

In OS/2 and Windows functions can be placed in a DLL.  A program that uses
DLLs does not have a copy of the function in its .exe.  Instead it just
contains information on where to find the function when it needs it.  This
allows .exe files to be smaller.  Another advantage is only one copy of the
function needs to be in memory.

DLLs provide a more sensible way to offer common functionality than statically
linked libraries.

Ken Sykes
Disclaimer: The above opinions are solely my own.

phil@brahms.amd.com (Phil Ngai) (09/15/90)

In article <57434@microsoft.UUCP> kensy@microsoft.UUCP (Ken SYKES) writes:
|In OS/2 and Windows functions can be placed in a DLL.  A program that uses
|DLLs does not have a copy of the function in its .exe.  Instead it just
|contains information on where to find the function when it needs it.  This
|allows .exe files to be smaller.

Oh, that's how Microsoft got "winword.exe" to be so small. How
wonderful! :-)

--
Phil Ngai, phil@amd.com		{uunet,decwrl,ucbvax}!amdcad!phil
"Why would Xerox Corp. want a paperless office?"