I’m trying to get my head around when and why DllMain() is called. Here’s what I’ve learned so far:
DllMain( DLL_PROCESS_ATTACH ) is called when any application using the dll starts;
DllMain( DLL_PROCESS_DETACH ) gets called when the application using the dll terminates;
Both DllMain( DLL_THREAD_ATTACH ) and DllMain( DLL_THREAD_DETACH ) are only called if the calling application starts/ends a new thread; and
That if more than one application uses the same dll then DllMain( DLL_PROCESS_ATTACH ) will be called each time any of these applications starts. And each time one of these applications terminates then a corresponding call to DllMain( DLL_PROCESS_DETACH ) will be made.
Sound right?
Pat
DllMain( DLL_PROCESS_ATTACH ) is called when any application using the dll starts;
DllMain( DLL_PROCESS_DETACH ) gets called when the application using the dll terminates;
Both DllMain( DLL_THREAD_ATTACH ) and DllMain( DLL_THREAD_DETACH ) are only called if the calling application starts/ends a new thread; and
That if more than one application uses the same dll then DllMain( DLL_PROCESS_ATTACH ) will be called each time any of these applications starts. And each time one of these applications terminates then a corresponding call to DllMain( DLL_PROCESS_DETACH ) will be made.
Sound right?
Pat
Comment