Quote:
Originally posted by Fordy
Most likely they link at run time (explicit linking).....see novacain's code above....
First you create a typedef of the function you want to import....this defines a function pointer...
Then call LoadLibrary()......If the dll is already mapped into your process, it returns a handle, otherwise it maps it, relocates it, calls its entrypoint and then returns a handle...
Then call GetProcAddress() with the module handle and you will get a pointer to the start of that imported function.....cast this back to your typedef'ed function pointer and you can use the function at will!!!
Dont forget FreeLibrary() after youve finished...this decreases the dll's usage count and unmaps it after its not needed
So, when you implicity link the DLL, this is similiar to the old static lib's? You only use explicit linking when you don't need the DLL that much just in certain situations? I'm having a hard time seeing from a practical standpoint the differences between dll's and lib's.