home *** CD-ROM | disk | FTP | other *** search
- /*
- ** DLL.C - This is the ODBC sample driver code for
- ** LIBMAIN processing.
- **
- ** This code is furnished on an as-is basis as part of the ODBC SDK and is
- ** intended for example purposes only.
- **
- */
-
- // - - - - - - - - -
-
- #include "sample.h"
-
- HINSTANCE NEAR s_hModule; // Saved module handle.
-
- #ifdef _WIN32
-
- int __stdcall LibMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved)
- {
- switch (ul_reason_being_called)
- {
- case DLL_PROCESS_ATTACH: // case of libentry call in win 3.x
- s_hModule = hInst;
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_PROCESS_DETACH: // case of wep call in win 3.x
- break;
- case DLL_THREAD_DETACH:
- break;
- default:
- break;
- } /* switch */
-
- return TRUE;
-
- UNREFERENCED_PARAMETER(lpReserved);
- } /* LibMain */
-
- #else // _WIN32
-
- // - - - - - - - - -
-
- // This routine is called by LIBSTART.ASM at module load time. All it
- // does in this sample is remember the DLL module handle. The module
- // handle is needed if you want to do things like load stuff from the
- // resource file (for instance string resources).
-
- int _export FAR PASCAL libmain(
- HANDLE hModule,
- short cbHeapSize,
- UCHAR FAR *lszCmdLine)
- {
- s_hModule = hModule;
- return TRUE;
- }
-
- #endif // _WIN32
-
- void EXPFUNC FAR PASCAL LoadByOrdinal(void);
- // Entry point to cause DM to load using ordinals
- void EXPFUNC FAR PASCAL LoadByOrdinal(void)
- {
- }
-