home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / REFERENC / VB_GRID / CCINIT.C next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  2.4 KB  |  91 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 "grid.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, &modelGrid))
  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.     hcurHSep  = LoadCursor(hmodDLL, MAKEINTRESOURCE(IDCUR_HSEP));
  64.     hcurVSep  = LoadCursor(hmodDLL, MAKEINTRESOURCE(IDCUR_VSEP));
  65.     hcurArrow = LoadCursor(NULL, IDC_ARROW);
  66.  
  67.     // Leave our DS unlocked when we're not running
  68.  
  69.     UnlockData( 0 );
  70.  
  71.     return TRUE;
  72. }
  73.  
  74. //---------------------------------------------------------------------------
  75. // Handle exit notification from Windows
  76. //    This routine is called by Windows when the library is freed
  77. //    by its last client.
  78. //---------------------------------------------------------------------------
  79.  
  80. VOID FAR _export WEP
  81. (
  82.     BOOL    fSystemExit
  83. )
  84. {
  85.     // avoid warnings on unused (but required) formal parameters
  86.  
  87.     fSystemExit = fSystemExit;
  88. }
  89.  
  90. //---------------------------------------------------------------------------
  91.