I created a dll file, and I wanted the resources it uses to be initialized when the dll gets loaded, so I wanted to include DllMain function in the dll file.
Do I need to compile DllMain.cpp file along with the sources for the dll
int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*pReserved*/)
file for the above DllMain() function to be called? or can I 1) compile the dllmain.cpp file into a .lib library file 2) statically link the library to the dll during a link-time?
Also, do I need to export the DllMain function (using the.def file for the dll file)? Thanks!