Codeguru Visual C / MFC Tutorials. Read More in Tutorials » I was trying to learn DLLs and nothing was really explaining anything; it was just code for you to look at and wonder what was going on. H" and removed "DLL_Tutorial. h". The reason is simply because Windows. h contains many Windows functions and you will need only a few right now. It also contains some Windows-specific variables that you will use. If you plan on calling member functions of an instance of C class you will need to provide forwarding functions. You will also need to provide at least one function to return a pointer to an instance of the class you want to access. After the call to LoadLibrary, you must check to see whether the function succeeded. You can do so by checking whether the HINSTANCE is equal to NULL (defined as You will need function pointers and some Windows functions. But, by loading DLLs this way, you do not need the.lib or the header file for the DLL, only the DLL. I'll list some code and then explain it. The first way is a tad bit easier to do than the second, but both work just fine. _declspec(dllexport) exports the function symbols to a storage class in your DLL. I defined DECLDIR to do this function when the line #define DLL_EXPORT is defined, but. If you don't want to do this, you can always put them in the directory with your new project and use " (quot;s) instead of. That's how you load a DLL the easy way. Explicit Linking The harder way to load a DLL is a. The Function function takes no parameters, so you can leave that blank. The first two lines in main are the function pointers being declared so that you can set them equal to the functions inside the DLL. H #include windows. h int main HANDLE ldll; int (add2 int int (mul int, int ldll LoadLibrary mydll. dll if(ldll (void)HINSTANCE _ERROR ) add2 GetProcAddress(ldll, "add2 mul GetProcAddress(ldll, "mul printf add2(3 dnmul(4,5 d add2(3 mul(4,5 else printf ERROR.