DllMain Callback Function

An optional entry point into a dynamic-link library (DLL). When the system starts or terminates a process or thread, it calls the entry-point function for each loaded DLL using the first thread of the process. The system also calls the entry-point function for a DLL when it is loaded or unloaded using the LoadLibrary and FreeLibrary functions.

DLL的一个可选入口。当系统启动或者终止一个进程或者一个线程时,系统为每个被加载的DLL在进程的第一个线程中调用入口函数。当使用LoadLibrary和FreeLibrary加载或者卸载DLL时,系统也会调用入口函数。

Warning  There are serious limits on what you can do in a DLL entry point. To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL.

警告:在DLL的入口中可以做的事情是有很严格的限制的。如果要提供更加复杂的初始化,应该为这个DLL创建一个initialization routine。你可以要求应用在调用其他代码前执行这段初始化代码。

原文地址:https://www.cnblogs.com/whyandinside/p/1768196.html