home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / circ1.c_ / circ1.bin
Text File  |  1993-04-28  |  4KB  |  123 lines

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1991-93, Microsoft Corporation
  3. //
  4. // You have a royalty-free right to use, modify, reproduce and distribute
  5. // the Sample Custom Control Files (and/or any modified version) in any way
  6. // you find useful, provided that you agree that Microsoft has no warranty,
  7. // obligation or liability for any Custom Control File.
  8. //---------------------------------------------------------------------------
  9. // Circ1.c
  10. //---------------------------------------------------------------------------
  11. // Contains control procedure for CIRC1 control
  12. //---------------------------------------------------------------------------
  13.  
  14. #include <windows.h>
  15. #include <vbapi.h>
  16. #include "circ1.h"
  17.  
  18. //---------------------------------------------------------------------------
  19. // Global Variables
  20. //---------------------------------------------------------------------------
  21. HANDLE hmodDLL;
  22.  
  23.  
  24. //---------------------------------------------------------------------------
  25. // Circle Control Procedure
  26. //---------------------------------------------------------------------------
  27. LONG FAR PASCAL _export CircleCtlProc
  28. (
  29.     HCTL   hctl,
  30.     HWND   hwnd,
  31.     USHORT msg,
  32.     USHORT wp,
  33.     LONG   lp
  34. )
  35. {
  36.     return VBDefControlProc(hctl, hwnd, msg, wp, lp);
  37. }
  38.  
  39.  
  40. //---------------------------------------------------------------------------
  41. // Initialize library. This routine is called when the first client loads
  42. // the DLL.
  43. //---------------------------------------------------------------------------
  44. int FAR PASCAL LibMain
  45. (
  46.     HANDLE hModule,
  47.     WORD   wDataSeg,
  48.     WORD   cbHeapSize,
  49.     LPSTR  lpszCmdLine
  50. )
  51. {
  52.     // Avoid warnings on unused (but required) formal parameters
  53.     wDataSeg    = wDataSeg;
  54.     cbHeapSize    = cbHeapSize;
  55.     lpszCmdLine = lpszCmdLine;
  56.  
  57.     hmodDLL = hModule;
  58.  
  59.     return 1;
  60. }
  61.  
  62.  
  63. //---------------------------------------------------------------------------
  64. // Register custom control. This routine is called by VB when the custom
  65. // control DLL is loaded for use.
  66. //---------------------------------------------------------------------------
  67. BOOL FAR PASCAL _export VBINITCC
  68. (
  69.     USHORT usVersion,
  70.     BOOL   fRuntime
  71. )
  72. {
  73.     // Avoid warnings on unused (but required) formal parameters
  74.     fRuntime  = fRuntime;
  75.     usVersion = usVersion;
  76.  
  77.     // Register control(s)
  78.     return VBRegisterModel(hmodDLL, &modelCircle);
  79. }
  80.  
  81.  
  82. //---------------------------------------------------------------------------
  83. // WEP
  84. //---------------------------------------------------------------------------
  85. // C7 and QCWIN provide default a WEP:
  86. //---------------------------------------------------------------------------
  87. #if (_MSC_VER < 610)
  88.  
  89. int FAR PASCAL WEP(int fSystemExit);
  90.  
  91. //---------------------------------------------------------------------------
  92. // For Windows 3.0 it is recommended that the WEP function reside in a
  93. // FIXED code segment and be exported as RESIDENTNAME.  This is
  94. // accomplished using the alloc_text pragma below and the related EXPORTS
  95. // and SEGMENTS directives in the .DEF file.
  96. //
  97. // Read the comments section documenting the WEP function in the Windows
  98. // 3.1 SDK "Programmers Reference, Volume 2: Functions" before placing
  99. // any additional code in the WEP routine for a Windows 3.0 DLL.
  100. //---------------------------------------------------------------------------
  101. #pragma alloc_text(WEP_TEXT,WEP)
  102.  
  103. //---------------------------------------------------------------------------
  104. // Performs cleanup tasks when the DLL is unloaded.  WEP() is
  105. // called automatically by Windows when the DLL is unloaded (no
  106. // remaining tasks still have the DLL loaded).    It is strongly
  107. // recommended that a DLL have a WEP() function, even if it does
  108. // nothing but returns success (1), as in this example.
  109. //---------------------------------------------------------------------------
  110. int FAR PASCAL WEP
  111. (
  112.     int fSystemExit
  113. )
  114. {
  115.     // Avoid warnings on unused (but required) formal parameters
  116.     fSystemExit = fSystemExit;
  117.  
  118.     return 1;
  119. }
  120. #endif // C6
  121.  
  122. //---------------------------------------------------------------------------
  123.