This problem has been solved, the reason is No call to InitializeCriticalSection(...);for I used the loadlibrary(*.dll),which leave the global variables(_AtlWinModule,_AtlBaseModule,_AtlComModule which is used by ATL components later) uninitialized. So in this situation, Adding _CRT_INIT to the DLLMain could overcome the access vialation, the crt_INIT function could help initialize the related global varible. like :
add _CRT_INIT in the:
DLLMain(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
_CRT_INIT(hModule,ul_reason_for_call,lpReserved);
}