When to use dllmain and when just use function in dll file?
Printable View
When to use dllmain and when just use function in dll file?
If you need to initialise some extra data, you use DllMain. It gets executed every time either a process or a thread attaches to it (it tells you in the parameters what's happening). It is also called when it is unloaded as well.
So basically, if you had functions in your DLL to print signs, you might load the actual sign images in DllMain, then just use them from memory as necessary :)