home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / kwclass.zip / KWCLASS.CPP < prev    next >
C/C++ Source or Header  |  1994-04-18  |  2KB  |  85 lines

  1. /*---------------------------------------------------------------
  2.  * kwclass.cpp:
  3.  *
  4.  * Generated by the KASE:VIP User Interface Class Library    
  5.  * knowledgebase                                               
  6.  * 
  7.  *--------------------------------------------------------------*/
  8.  
  9. /*
  10.  * Copyright (C) 1994, by KASEWORKS, Inc.
  11.  */
  12. /*---------------------------------------------------------------
  13.  * PROFILE INFORMATION:
  14.  *
  15.  * OBJECT MODIFICATION DATE:
  16.  *
  17.  *   
  18.  *
  19.  *--------------------------------------------------------------*/
  20. #include <ihandle.hpp>
  21.   
  22. #include <iapp.hpp>
  23. #include "kwclass.hpp"
  24. #include "kwclass.rch"
  25. IModuleHandle KwclassDloHandle;
  26.  
  27.  
  28.  
  29. extern "C"
  30.   int _CRT_init(void);
  31.  
  32. extern "C"
  33.   void __ctordtorInit(void);
  34.  
  35. extern "C"
  36.   unsigned long _System _DLL_InitTerm(unsigned long hModule, 
  37.                                       unsigned long ulFlag);
  38.  
  39. /*-------------------------------------------------------------
  40.  * Name: _DLL_InitTerm 
  41.  *
  42.  * Syntax:
  43.  *   
  44.  *   _DLL_InitTerm(hModule, ulFlag)
  45.  *
  46.  * Description: 
  47.  *   DLL initialization routine.  Called when the DLL is loaded
  48.  *   or unloaded by an application.  This function initializes
  49.  *   the runtime environment for C and C++, and saves the DLL's
  50.  *   module handle for access by DLL components. 
  51.  *
  52.  * Parameters:
  53.  *   hModule      - the module handle for the DLL
  54.  *   ulFlag       - indicates whether the DLL is being loaded or
  55.  *                  unloaded (0 = load, 1 = unload)
  56.  *
  57.  * Return Value:
  58.  *   Indicates whether the DLL was loaded successfully.  Returning
  59.  *   nonzero indicates success, zero indicates failure.  If the 
  60.  *   function returns zero, the system will not load the DLL.
  61.  *
  62.  * Notes:
  63.  *   Global and static objects residing in the DLL are not 
  64.  *   constructed until the function __ctordtorInit is called.
  65. ------------------------------------------------------------*/ 
  66. extern "C"
  67. unsigned long _System _DLL_InitTerm(unsigned long hModule, 
  68.                                     unsigned long ulFlag)
  69. {
  70.   if (ulFlag == 0)
  71.   {
  72.     // initialize the C runtime library
  73.     if (_CRT_init() == -1)
  74.       return 0;
  75.     
  76.     // construct global objects
  77.     __ctordtorInit();
  78.    
  79.     // save the DLL's module handle
  80.     KwclassDloHandle = hModule;
  81.     return 1;
  82.   }  
  83. }
  84.  
  85.