As we all know, dll's entry point is DllMain(). Now consider when to initialize all global and static data, the time happens earlier than calling DllMain()!

You can easily know this by debugging.

In CRTMainStartUp(),

First: _INIT_CRT --- to do globa and static initalization.

Second: call DllMain.

Remember this.