I am going through my project code base, which consits of libraries and
applications. Some libraries are Dll’s. Code is written in C++ for Windows
using MS VS 2010.
I taught for Dll we should write DllMain function which is entry point for
the DLL application. But in my project for DLL “DllMain” function is not present.
My question when we require DllMain and when it is not required?
Thanks for your time and help.
DllMainis not mandatory. If you have some initialization code required to run when loading the dll, you should create aDllMainfunction, and treat the initialization there. Otherwise it’s not required.See here some more information.