Max 5 API Reference
00001 #ifdef WIN_VERSION 00002 00003 #include "ext.h" 00004 #include <windows.h> 00005 00006 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved ) 00007 { 00008 // Perform actions based on the reason for calling. 00009 switch( fdwReason ) 00010 { 00011 case DLL_PROCESS_ATTACH: 00012 // Initialize once for each new process. Return FALSE to fail DLL load. 00013 // Since we do nothing in our DLL_THREAD_ATTACH and DLL_THREAD_DETACH calls below, 00014 // we don't need to actually receive those calls. The below call tells the OS to 00015 // optimize those out. 00016 DisableThreadLibraryCalls(hinstDLL); 00017 #ifdef _DEBUG 00018 { 00019 char buff[_MAX_PATH]; 00020 OutputDebugString("DLL_PROCESS_ATTACH: "); 00021 GetModuleFileName(hinstDLL, buff, _MAX_PATH); 00022 OutputDebugString(buff); 00023 OutputDebugString("\n"); 00024 } 00025 #endif 00026 break; 00027 case DLL_THREAD_ATTACH: 00028 // Do thread-specific initialization. 00029 break; 00030 case DLL_THREAD_DETACH: 00031 // Do thread-specific cleanup. 00032 break; 00033 case DLL_PROCESS_DETACH: 00034 // Perform any necessary cleanup. 00035 break; 00036 } 00037 return TRUE; 00038 } 00039 00040 #endif // #ifdef WIN_VERSION 00041
Copyright © 2008, Cycling '74