1、DLL有静态调用和动态调用两种被使用的方式;
2、DLL也有个入口函数
1 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 2 { 3 printf("hModule.%p lpReserved.%p ", hModule, lpReserved); 4 5 switch (ul_reason_for_call) 6 { 7 case DLL_PROCESS_ATTACH: 8 printf("Process attach. "); 9 break; 10 11 case DLL_PROCESS_DETACH: 12 printf("Process detach. "); 13 break; 14 15 case DLL_THREAD_ATTACH: 16 printf("Thread attach. "); 17 break; 18 19 case DLL_THREAD_DETACH: 20 printf("Thread detach. "); 21 break; 22 } 23 24 return (TRUE); 25 }