How to use a dll
<p>I recently was very confused in trying to use gdi+, since the sdk files where just three files, one of which being a .dll file. I assumed I need to load the dll and since I had never been taught or exposed to such things, needless to say I was bewildered. (it now seems that the installation also put gdi+ sdk files in the folder which VS looks for standard files (the things that are included via &lt;>, and still leaves me clueless as to what the dll is doing there).</p>

<p>I researched and got an explanation that seemed to suggest the following:</p>

<p>A .dll file is a file who's code is loaded into memory when it is executed, saving time by referencing the memory via pointers rather than copying the code as a standard lib load does. This also allows versatility for changing the dll without changing the executable file.</p>

<p>To use it, you must use loadlibrary, and then getprocaddress to basically get a pointer (or something, wasn't clear to me) to <em>specific</em> elements, such as a class or function, in the dll. </p>

<p>You see, I was under the impression that a library is basically code you are to reuse for things, the same concept, but a more efficient form of simply makes .cpp files of useful methods and classes and then including them.</p>

<p>From what I can tell, this assumption is incorrect and I would like someone who knows the inside and out of this .lib and .dll library thing to explain it if they please. </p>

<p>Please remember that my current understanding of the purpose of a dll or lib is to reuse code. Make a file with classes and methods and then just import it in to use it. I am extremely inexperienced with libraries in this sense.</p>