When To initialize global and static data For DLL

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.

posted @ 2009-07-10 18:15  能巴  阅读(228)  评论(0编辑  收藏  举报