home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a044 / 3.ddi / MISC / SAMPLE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-31  |  999 b   |  52 lines

  1. //
  2. // Sample - Sample DLL for CA-dBFast 2.0
  3. //
  4.  
  5. #include <windows.h>
  6.  
  7.  
  8. // All DLLs have a LibMain ( Called when the DLL is loaded )
  9. int FAR PASCAL LibMain( HINSTANCE hInstance,
  10.                         WORD wDataSeg,
  11.                         WORD wHeapSize,
  12.             LPSTR lpszCmdLine )
  13. {
  14.   if ( wHeapSize > 0 )
  15.     UnlockData( 0 );
  16.  
  17.   return TRUE;
  18. }
  19.  
  20.  
  21. // and a WEP ( Windows Exit Point )
  22. int CALLBACK WEP( int nParameter )
  23. {
  24.   return 1;
  25. }
  26.  
  27.  
  28. // return the addition of the two numbers passed as args
  29. int FAR PASCAL AddTwoNumbers( int nNumber1, int nNumber2 )
  30. {
  31.   return nNumber1 + nNumber2;
  32. }
  33.  
  34.  
  35. // swap the elements of an integer array
  36. int FAR PASCAL SwapIntArray( int lpIntArray[] )
  37. {
  38.   int nTemp;
  39.   int nIndex;
  40.   int nArraySize = 4;
  41.  
  42.  
  43.   for( nIndex=0;nIndex < ( nArraySize / 2 );nIndex++ )
  44.     {
  45.     nTemp = lpIntArray[nIndex];
  46.     lpIntArray[nIndex] = lpIntArray[nArraySize - nIndex];
  47.     lpIntArray[nArraySize - nIndex] = nTemp;
  48.     }
  49.          
  50.   return 0;
  51. }
  52.