home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / INCLUDE / DLL.CH < prev    next >
Text File  |  1994-05-25  |  1KB  |  35 lines

  1. #ifndef _DLL_CH
  2. #define _DLL_CH
  3.  
  4. #define VOID     0
  5. #define BYTE     1
  6. #define CHAR     2
  7. #define WORD     3
  8. #define INT      4
  9. #define BOOL     5
  10. #define HDC      6
  11. #define LONG     7
  12. #define STRING   8
  13. #define LPSTR    9
  14. #define PTR     10
  15. #define _DOUBLE 11         // conflicts with BORDER DOUBLE
  16.  
  17. // uufff!!!   :-)
  18.  
  19. #xcommand DLL [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ] ;
  20.                                                      [, <uParamN> AS <typeN> ] ) ;
  21.              AS <return> [<pascal:PASCAL>] LIB <*DllName*> ;
  22.        => ;
  23.           [<static>] function <FuncName>( [<uParam1>] [,<uParamN>] ) ;;
  24.              local hDLL := LoadLibrary( <(DllName)> ) ;;
  25.              local cFarProc ;;
  26.              local uResult ;;
  27.              if hDLL != 0 ;;
  28.                 cFarProc = GetProcAddress( hDLL, <(FuncName)>, [<.pascal.>], <return>, <type1> [,<typeN>] ) ;;
  29.                 uResult = CallDLL( cFarProc, [<uParam1>] [,<uParamN>] ) ;;
  30.                 FreeLibrary( hDLL ) ;;
  31.              end ;;
  32.           return uResult
  33.  
  34. #endif
  35.