home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / odbcsdk / samples / smpldrvr / dll.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-07  |  1.6 KB  |  65 lines

  1. /*
  2. ** DLL.C - This is the ODBC sample driver code for
  3. ** LIBMAIN processing.
  4. **
  5. **    This code is furnished on an as-is basis as part of the ODBC SDK and is
  6. **    intended for example purposes only.
  7. **
  8. */
  9.  
  10. //    -    -    -    -    -    -    -    -    -
  11.  
  12. #include "sample.h"
  13.  
  14. HINSTANCE NEAR s_hModule;        // Saved module handle.
  15.  
  16. #ifdef _WIN32
  17.  
  18. int __stdcall LibMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved) 
  19. {
  20.     switch (ul_reason_being_called) 
  21.     {
  22.         case DLL_PROCESS_ATTACH:    // case of libentry call in win 3.x
  23.             s_hModule = hInst; 
  24.             break;
  25.         case DLL_THREAD_ATTACH:
  26.             break;
  27.         case DLL_PROCESS_DETACH:    // case of wep call in win 3.x
  28.             break;
  29.         case DLL_THREAD_DETACH:
  30.             break;
  31.         default:
  32.             break;
  33.     } /* switch */
  34.  
  35.     return TRUE;                                                                
  36.                                                                                 
  37.     UNREFERENCED_PARAMETER(lpReserved);                                         
  38. } /* LibMain */
  39.  
  40. #else    //    _WIN32
  41.  
  42. //    -    -    -    -    -    -    -    -    -
  43.  
  44. //    This routine is called by LIBSTART.ASM at module load time.  All it
  45. //    does in this sample is remember the DLL module handle.    The module
  46. //    handle is needed if you want to do things like load stuff from the
  47. //    resource file (for instance string resources).
  48.  
  49. int _export FAR PASCAL libmain(
  50.     HANDLE       hModule,
  51.     short       cbHeapSize,
  52.     UCHAR FAR *lszCmdLine)
  53. {
  54.     s_hModule = hModule;
  55.     return TRUE;
  56. }
  57.  
  58. #endif    //    _WIN32
  59.  
  60. void EXPFUNC FAR PASCAL LoadByOrdinal(void);
  61. //    Entry point to cause DM to load using ordinals
  62. void EXPFUNC FAR PASCAL LoadByOrdinal(void)
  63. {
  64. }
  65.