Sign in to follow this  
romainechester

What do *.dll files do?

Recommended Posts

DLLs are libraries of functions or classes. If you include them in a project, you can access the things in the DLL as you would if you had defined the classes or functions yourself. The reason (or at least a reason that they are useful is that if you need to update a portion of code, you only need to recompile the dll rather than the whole thing. Hope that helps.

Share this post


Link to post
Share on other sites
DLL files contain code in them, just like executable files (.exe). The difference is that DLL files don't represent an entire program. You can't run them. But an executable can attach or link to them while it is running (that's why they're called "dynamic link libraries") and execute the code that is contained within them. A DLL will typically have multiple functions, and the executable can choose any of those functions to call at any time.

DLLs are good for one thing because multiple executables can use the same DLL to get functionality that they all need, without having to waste space by putting all that functionality into the executables themselves. For example, all DirectX games use the DirectX DLLs that are in the Windows System folder. That means that A) each of these .exe files do not need to include all the code that is part of DirectX, and B) whenever the DirectX DLLs get updated, every DirectX game is automatically updated as well. This second one is the other big feature of DLLs, the ability to update features easily. Mods for games are often in the form of DLLs. In fact, some games themselves are DLLs: The engine (graphics/physics/networking/input/etcetera) is an executable file, and then the game-specific stuff (story/menus/game flow/etcetera) would be in a DLL. If you wanna make a new game, but use the same engine, just make a new DLL.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The idea is simple. Dll file is almost an ordinary exe file. There are, of cource, some differences. Dll's cannot be executed like exe files. They can be loaded or unloaded by a exe file when the program needs the code inside the particular dll. For instance, You writes an application that uses Direct3D ( part of DirectX resposible for graphics. In fact, it's just d3d.dll ). You can 'attach' the dll in two ways:

1. static. Here the need of the dll is written in the exe file and Windows loads it into RAM memory before your program.

2. dynamic. In this case, You load the particular dll using LoadLibrary() and then you find procedures you want to use, which are placed in the dll.

Summary
Dll are provided to divede the whole program code to a number of logical parts ( modules ). The main module ( exe file ) is the most important and it can menage the dll ( use the parts of the code they contain ). Moreover, it is easier to you to write/debug or update your software when you use dlls. Imagine, you wrote a big app in one file. Then there is an error. Hard to find ? Does it compile to long ? Do you have to send all your clients new version instead of just a small patch ?

Share this post


Link to post
Share on other sites
ok, if a .dll file is something like an exe file just not executable, could i then make a dll file in delphi/vb/whatever other language you can think of and then use it in combination with my c++ program?

Share this post


Link to post
Share on other sites
<disclaimer>While I'm not an expert on the subject</disclaimer>, yes, I think you can. That is, providing the data types/structures you will be using are compatible.

Share this post


Link to post
Share on other sites
Quote:
Original post by BiGF00T
ok, if a .dll file is something like an exe file just not executable, could i then make a dll file in delphi/vb/whatever other language you can think of and then use it in combination with my c++ program?


Its been a few years since I used vb. But at that time you could not. You can use DLLs IN vb, but not make them with vb.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this