home *** CD-ROM | disk | FTP | other *** search
- //
- // Sample - Sample DLL for CA-dBFast 2.0
- //
-
- #include <windows.h>
-
-
- // All DLLs have a LibMain ( Called when the DLL is loaded )
- int FAR PASCAL LibMain( HINSTANCE hInstance,
- WORD wDataSeg,
- WORD wHeapSize,
- LPSTR lpszCmdLine )
- {
- if ( wHeapSize > 0 )
- UnlockData( 0 );
-
- return TRUE;
- }
-
-
- // and a WEP ( Windows Exit Point )
- int CALLBACK WEP( int nParameter )
- {
- return 1;
- }
-
-
- // return the addition of the two numbers passed as args
- int FAR PASCAL AddTwoNumbers( int nNumber1, int nNumber2 )
- {
- return nNumber1 + nNumber2;
- }
-
-
- // swap the elements of an integer array
- int FAR PASCAL SwapIntArray( int lpIntArray[] )
- {
- int nTemp;
- int nIndex;
- int nArraySize = 4;
-
-
- for( nIndex=0;nIndex < ( nArraySize / 2 );nIndex++ )
- {
- nTemp = lpIntArray[nIndex];
- lpIntArray[nIndex] = lpIntArray[nArraySize - nIndex];
- lpIntArray[nArraySize - nIndex] = nTemp;
- }
-
- return 0;
- }
-