I am currently generating a dll file in c++ VS2010 .I had two questions I wanted to know if I am currently generating a static dll or a dynamic dll ? In my code I have a .def file and all my exported functions are numbered in that def file. Also my functions are being exported using __declspec(dllexport).
Share
When you generate a DLL you will get a Dynamic Link Library. So independent on the method you generate it, it is dynamically loaded.
But there is a difference how you access the functions from your cosuming application.
When you use the import library (yourDllName.LIB) the DLL will be loaded when your application is loaded. This gives a similar look&feel as if you would use a static library.
You can also use LoadLibrary and GetProcAddress to get a pointer to the functions. Then you can call your functions using these pointers to the DLL entrypoints.
If you choose the module export file (.DEF) ot the __declspec(dllexport) method to put the function to the export table doesn’t care. I recommend using one method to avoid confusion.