home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Super Store 2.3 / TESTDRIVE_2.ISO / realizer / samples / refch26 / mydll.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-30  |  1.7 KB  |  79 lines

  1. /*************************************************************
  2.  *    Realizer Reference Manual Sample Program
  3.  *
  4.  *    Chapter 26:  MyDLL.c
  5.  *
  6.  *    Copyright ⌐ 1991-1992 Computer Associates International, Inc.
  7.  *    All rights reserved.
  8.  *************************************************************/
  9.  
  10. typedef unsigned int    WORD; 
  11. typedef char far        *LPSTR; 
  12. typedef WORD            HANDLE; 
  13. typedef HANDLE            HWND; 
  14.  
  15. /* 
  16.  *  Uppercase - converts all letters in a string to uppercase. 
  17.  */ 
  18.  
  19. void far pascal Uppercase(LPSTR s) 
  20.     while (*s) { 
  21.         if ((*s >= 'a') && (*s <= 'z')) 
  22.             *s -= 32; 
  23.         s++; 
  24.     } 
  25.  
  26. /* 
  27.  * FindMatch - finds the first occurrence of x within a real array. 
  28.  * 
  29.  * Returns the index of the matching element, or 0 if it isn't found. 
  30.  * The index is based on the Realizer style, with 1 as the 
  31.  * first element. 
  32.  */ 
  33.  
  34. WORD far pascal FindMatch(double far *array, WORD len, double x) 
  35.     int i; 
  36.  
  37.     for (i = 0; i < len; i++) 
  38.         if (array[i] == x) 
  39.             return(i + 1); 
  40.     return(0); 
  41.  
  42.  
  43. /* 
  44.  * LibMain - DLL initialization routine 
  45.  * 
  46.  * The LibMain function is required for each DLL.  It is called when 
  47.  * the DLL is first loaded.  Any initialization for the library should  
  48.  * be done here.  LibMain should return a value of 1 if the 
  49.  * initialization is successful.           
  50.  */ 
  51.  
  52. int far pascal LibMain(hModule, wDataSeg, cbHeapSize, lpszCmdLine) 
  53.  
  54. WORD    wDataSeg; 
  55. WORD    cbHeapSize; 
  56. LPSTR   lpszCmdLine; 
  57.     return 1; 
  58.  
  59.  
  60. /* 
  61.  * WEP - DLL cleanup routine 
  62.  * 
  63.  * The WEP function should also be found in each DLL.  It is called when 
  64.  * the DLL is unloaded.  There is no return value. 
  65.  */ 
  66.  
  67. void far pascal WEP(bSystemExit) 
  68. int  bSystemExit; 
  69.     return; 
  70.  
  71.