home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / filelist / ccinit.c next >
C/C++ Source or Header  |  1991-10-29  |  2KB  |  90 lines

  1. //---------------------------------------------------------------------------
  2. // ccInit.c
  3. //---------------------------------------------------------------------------
  4. // Custom Control DLL Initialization
  5. //---------------------------------------------------------------------------
  6.  
  7. #define NOCOMM
  8.  
  9. #include <windows.h>
  10.  
  11. #define CTL_DATA    // cause the control structures to be declared
  12.  
  13. #include "vbapi.h"
  14. #include "filelist.h"
  15.  
  16. HANDLE    hmodDLL;
  17.  
  18. //---------------------------------------------------------------------------
  19. // Register custom control.
  20. //    This routine is called by VB when the custom control DLL is
  21. //    loaded for use.
  22. //---------------------------------------------------------------------------
  23.  
  24. BOOL FAR PASCAL _export VBINITCC
  25. (
  26.     USHORT usVersion,
  27.     BOOL fRuntime
  28. )
  29. {
  30.     // avoid warnings on unused (but required) formal parameters
  31.  
  32.     fRuntime = fRuntime;
  33.     usVersion = usVersion;
  34.  
  35.     // Register control(s)
  36.  
  37.     if (!VBRegisterModel(hmodDLL, &modelList))
  38.     return FALSE;
  39.  
  40.     return TRUE;
  41. }
  42.  
  43. //---------------------------------------------------------------------------
  44. // Initialize library.
  45. //    This routine is called from the DLL entry point in LIBINIT.ASM
  46. //    which is called when the first client loads the DLL.
  47. //---------------------------------------------------------------------------
  48.  
  49. BOOL FAR LibMain
  50. (
  51.     HANDLE    hmod,
  52.     HANDLE    segDS,
  53.     USHORT    cbHeapSize
  54. )
  55. {
  56.     // avoid warnings on unused (but required) formal parameters
  57.  
  58.     cbHeapSize = cbHeapSize;
  59.     segDS = segDS;
  60.  
  61.     hmodDLL = hmod;
  62.  
  63.     // Allocate Heap
  64.     if (cbHeapSize != 0)
  65.         LocalInit (segDS, NULL, cbHeapSize);
  66.  
  67.     // Leave our DS unlocked when we're not running
  68.     UnlockData( 0 );
  69.  
  70.     return TRUE;
  71. }
  72.  
  73. //---------------------------------------------------------------------------
  74. // Handle exit notification from Windows
  75. //    This routine is called by Windows when the library is freed
  76. //    by its last client.
  77. //---------------------------------------------------------------------------
  78.  
  79. VOID FAR _export WEP
  80. (
  81.     BOOL    fSystemExit
  82. )
  83. {
  84.     // avoid warnings on unused (but required) formal parameters
  85.  
  86.     fSystemExit = fSystemExit;
  87. }
  88.  
  89. //---------------------------------------------------------------------------
  90.