I've seen them all over the place, what are they and what do they do?
Printable View
I've seen them all over the place, what are they and what do they do?
dll=Dynamic Link Library
Is a library module, which is not linked as a part of the program and is loaded dynamically at runtime
You can store your code in dll's
for example a lot of functions..........
So you can write a game.....
and u have u functions in the dll's
It's faster, when u edit some code, for example you can store you graphics engine for your game in the dll and you need to edit it you edit the function for the dll and don't need to recompile the whole prog..... cause u can load the dll at runtime
Additionally, multiple programs can use the same DLLs, cutting down disk space required for executables.
I think that the Windows API (Application Programming Interface) functions are implimented via DLLs. DirectX is probably a bunch of DLLs too.
My company has 3 or 4 different peices of similar hardware. They all run the same basic program, but each gets a different DLL (and driver). This seems opposite of how DLLs are usually used. Usually, many programs use the same DLL.
API uses DLL's, so does DirectX and some other libraries.
When you open a DLL file in a text editor, you see a bunch of what looks like crap, but it's actually the functions or your progam under text format. Try something like this and compare it with any DLL on your computer :
Code:// PROGRAM whatsadll.cpp
// COMPILED AS whatsadll.exe
#include <fstream.h>
#include <iostream.h>
#include <conio.c> // For getch();
ifstream fin;
ofstream fout;
char content;
int main()
{
fin.open("whatsadll.exe", ios::in); // Open your own program
fout.open("whatsadll.dll", ios::out); // Create a dll file for your program
while(fin.get(content))
{
cout << content;
fout << content;
} /* Grab all data under text form from your program and write it to screen and to a file. */
fin.close();
fout.close();
// Don't forget to close your files.
cout << "\n\nProgram executed.";
char a = getch(); /* To enable a pause to read what's on screen until someone hits a button */
return 0;
}
Chances are, what's on screen will not look what's in the file, because you'll have things like \a which will cause a beep when running but will not be written on screen, but will be in the file. Otherwise, they look the same.
My result :
Code:MZ @ !L!This program cannot be run in DOS mode.
$ PE L /= \ 8 F X ` @
` .text D F ` `.data P `
J @ .bss 0 p .idata `
T @
UEPPcA PEPh`A h `A E Z
]ÉUPPTcA tYA $A uQt"TcA Q
QRP $ $A tTcA Q@QRP
$ ]Ít& TcA QQRP $ $A
뎐& ' UVS1E1ۋ = = sE=
te[^] PPj j] ttރ
jЃPPjj7 PPj j% tt
jPPjj u = t=
tnt& USh@ R}
`A `A QRP z $J & ' UjA 1]Ð UjA
]g& UEPE EPh `A
f`A Pj P
EPE EPh j j P
jjo ÉU8EPj]
Pj EfEEfEEPEPEU)Pj
j P# EPEP
ÐU8EPj P Ef
EEfEEPEPEUPj j
P E֍PREԍPRo U帄
7 S MIfȋMIى% ȋMIfʋMIى ʉEUEPDž PDž fDžP
fDž P_Pj P
h@ EP E E EU)
9E~YE EU)9E~9EUЋU
э ]ىڍ_
EEE뛍v EU xU
EHfEEHfEEPj P
ÐU帄 _ Sh@ j _P
MIfȋMIى% ȋMIfʋMIى
ʉEUE
E EU)9E~ E EU)
9EEUЀ8 u fE Mʉ
ȍ_M]يE Mʉȍf
EE|EXEPDž PDž fDžP fDž P_PjP P}
xÉUEEEPj
PP Ív UEPj P-
UE`A Ef`A Pj
P ÉUE`A `A
UPjr P ÉU
(EPjI PV UBÉ
U(EPj P" UBwhatsadll.exe whatsadll.dll
Program executed. U$S h jh:@ h pA
5 h jhH@ hpA !5 hpA hPpA
ËP# u7v pA Ph0`A _ pA PhpA G 랉h pA
hpA
hV@ h0`A E11 ]U
} uQ} t'jh pA
jhpA %jhpA jh
pA 3ios PsA `7ostream 7istream 11fstreambase sA @@sA P @8ifstream sA @`sA P
@8ofstream 11_ios_fields Uh jÉUh j ÉU WVSǝ
\} tJEPU@PeA @@ BP @ @ f@ @ @ @ \AEE
Em@@ `EAU@cA } u1}
cA UPM)cA f
EȃUXR* \AE_E E
m@@ `E_AUXu@
@ @ @ @ f@ @ @ @ \A A AEu\B`Džd
h_h@H@ ``J} t
You can read pieces of intelligent things in there by looking carefully :) The beginning says "This program cannot be run in DOS mode.", the end has "ifstream" and "ostream" in them...