home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 11.ddi / OWLSRC.PAK / LIBMAIN.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.1 KB  |  43 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   source\owl\libmain.cpp
  4. //   Implementation of LibMain()
  5. //----------------------------------------------------------------------------
  6. #undef _BUILDOWLDLL
  7. #include <owl\owlpch.h>
  8. #include <owl\module.h>
  9.  
  10. DIAG_DECLARE_GROUP(OwlApp);        // General Application diagnostic group
  11.  
  12. #if defined(__WIN32__)
  13.  
  14. BOOL WINAPI
  15. DllEntryPoint(HINSTANCE hInstance, DWORD reason, LPVOID)
  16. {
  17.   TRACEX(OwlApp, 0, "DllEntryPoint(" << hInstance << ", " << reason << ", " <<
  18.          ") called");
  19.   
  20.   switch (reason) {
  21.     case DLL_PROCESS_ATTACH:
  22.       if (!::Module)
  23.         ::Module = new TModule(0, hInstance);
  24.   }
  25.   return TRUE;
  26. }
  27.  
  28. #else   // !defined(__WIN32__)
  29.  
  30. int
  31. FAR PASCAL
  32. LibMain(HINSTANCE   hInstance,
  33.         WORD      /*wDataSeg*/,
  34.         WORD      /*cbHeapSize*/,
  35.         char far* /*cmdLine*/)
  36. {
  37.   TRACEX(OwlApp, 0, "LibMain(" << (unsigned)hInstance << ",,,) called");
  38.   ::Module = new TModule(0, hInstance);
  39.   return TRUE;
  40. }
  41.  
  42. #endif  // defined(__WIN32__)
  43.