Changeset 2649 for trunk/src/twain_32/initterm.cpp
- Timestamp:
- Feb 5, 2000, 3:12:20 AM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/twain_32/initterm.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/twain_32/initterm.cpp
r2455 r2649 1 /* $Id: initterm.cpp,v 1. 7 2000-01-15 22:02:07sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.8 2000-02-05 02:11:41 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #include <odin.h> 34 34 #include <win32type.h> 35 #include <winconst.h> 35 36 #include <odinlx.h> 36 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ … … 49 50 extern int WINAPI PROFILE_GetOdinIniInt(LPCSTR section,LPCSTR key_name,int def); 50 51 TW_UINT16 (APIENTRY *TWAINOS2_DSM_Entry)( pTW_IDENTITY, pTW_IDENTITY, 51 TW_UINT32, TW_UINT16, TW_UINT16, TW_MEMREF) = 0;52 TW_UINT32, TW_UINT16, TW_UINT16, TW_MEMREF) = 0; 52 53 static HINSTANCE hTWAIN = 0; 53 54 54 55 } 56 //****************************************************************************** 57 //****************************************************************************** 58 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 59 { 60 switch (fdwReason) 61 { 62 case DLL_PROCESS_ATTACH: 63 return TRUE; 55 64 56 /*-------------------------------------------------------------------*/ 57 /* A clean up routine registered with DosExitList must be used if */ 58 /* runtime calls are required and the runtime is dynamically linked. */ 59 /* This will guarantee that this clean up routine is run before the */ 60 /* library DLL is terminated. */ 61 /*-------------------------------------------------------------------*/ 62 static void APIENTRY cleanup(ULONG reason); 65 case DLL_THREAD_ATTACH: 66 case DLL_THREAD_DETACH: 67 return TRUE; 63 68 64 69 case DLL_PROCESS_DETACH: 70 _ctordtorTerm(); 71 return TRUE; 72 } 73 return FALSE; 74 } 65 75 /****************************************************************************/ 66 76 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 133 143 } 134 144 } 135 /*******************************************************************/ 136 /* A DosExitList routine must be used to clean up if runtime calls */ 137 /* are required and the runtime is dynamically linked. */ 138 /*******************************************************************/ 139 140 if(RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab) == FALSE) 145 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 141 146 return 0UL; 142 143 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);144 if(rc)145 return 0UL;146 147 147 148 break; … … 161 162 return 1UL; 162 163 } 163 164 165 static void APIENTRY cleanup(ULONG ulReason) 166 { 167 _ctordtorTerm(); 168 DosExitList(EXLST_EXIT, cleanup); 169 return ; 170 } 164 //****************************************************************************** 165 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
