home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / ptk / mips / libmain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-12  |  1.3 KB  |  57 lines

  1. /*
  2. ** LIBMAIN.C - This is the module containing the initialization code for the
  3. ** ODS resource DLL.
  4. **
  5. ** (C) Copyright 1992-1994 By Microsoft Corp.
  6. */
  7.  
  8. #define WINVER 0x030A                // prevent Windows 3.1 feature usage
  9. #include "windows.h"
  10.  
  11.  
  12. /* DLL    initialization functions */
  13.  
  14. #ifdef _WIN32
  15.  
  16. INT __stdcall LibMain(HANDLE hInst, 
  17.                           DWORD ul_reason_being_called, 
  18.                           LPVOID lpReserved) 
  19. {
  20.     switch (ul_reason_being_called) 
  21.     {
  22.         case DLL_PROCESS_ATTACH:
  23.             // Initilize global variable here !!!
  24.             break;
  25.         case DLL_THREAD_ATTACH:
  26.             break;
  27.         case DLL_PROCESS_DETACH:
  28.             break;
  29.         case DLL_THREAD_DETACH:
  30.             break;
  31.         default:
  32.             break;
  33.     } /* switch */
  34.  
  35.     return TRUE;                                                                
  36.                                                                                 
  37.     UNREFERENCED_PARAMETER(hInst);                                         
  38.     UNREFERENCED_PARAMETER(lpReserved);                                         
  39. } /* LibMain */                                                                 
  40.  
  41. #else    //    _WIN32
  42.  
  43. int FAR PASCAL libmain(
  44.     HANDLE hinst,
  45.     short cbHeapSize,
  46.     LPSTR lpszCmdLine)
  47. {
  48.  
  49.     if (cbHeapSize != 0)        /* if DLL data segment is moveable */
  50.         UnlockData(0);
  51.  
  52.     return 1;                    /* successful initialization */
  53.  
  54. }
  55.  
  56. #endif    //    _WIN32
  57.