Jump to content
  • Advertisement
Sign in to follow this  
BTownTKD

DLLs 101

This topic is 4857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys -- I consider myself to be highly proficient in the C++ language, and I am just now starting to learn a little about programming with the Windows API on my path to learning game programming (everything up till now was just text console applications). I was wondering; I've seen DLLs included with tons of programs, and I have no idea what they are used for, exactly. Are they just like .h and .cpp files combined into one file? What are they useful for, and what advantages/disadvantages do they provide? Also, how do I go about making a DLL file and implementing it in my own projects? (i.e. would it be commonplace to make a bunch of useful classes and functions and put them all in a DLL for use with all games that I make? If so, how do I do this?) Is there someplace I can go to get information on DLLs for someone who has never used or made them before?

Share this post


Link to post
Share on other sites
Advertisement
Dlls are the same as exe but they can't be executed directly.

you can load a dll in your own app and call the functions within it.
they are mainly used in plug-ins type of things.

u can find information about dlls here on gamedev( i believe there was an article or two).

or u can Google.

hope this helps.

Share this post


Link to post
Share on other sites
DLL stands for Dynamic-Linked Library.

Normal (i.e. "static") libraries are linked by the linker. In other words, the address of a library function is "set" during linking. Because the library is part of the executable, the linker knows where the function is located so it can "set" the address in the code that calls the function.

In a DLL, the library is linked when the DLL is loaded, which happens while the program is running. In this case, the location of the function is not known until the DLL is loaded.

It can get a lot more complicated, but those are the basics.

Share this post


Link to post
Share on other sites
One advantage is abstraction, which comes in handy for implementing a driver. For example, Nvidia, ATI etc. each provide their own OpenGL DLL for their cards. The function calls are the same (mostly), but the implementation may be different for each card.

DLLs can be used when making mods for certain games too. The game must be designed to use the DLL though.

As far as game software though, you can easily get by without making your own DLLs. They're mostly excess baggage if you use them needlessly.

Share this post


Link to post
Share on other sites
I wrote a series of articles ages ago on stuffing Direct3D and OpenGL into their own DLL's..

Here's part I.

http://www.gamedev.net/reference/articles/article1672.asp

hth,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!