home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / DLLMIX.PAK / BCDLL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.7 KB  |  55 lines

  1. //----------------------------------------------------------------------------
  2. // Mixing BC++ built 32-bit DLL's with non-BC applications.
  3. // Copyright (c) 1996 by Borland International, All Rights Reserved
  4. //----------------------------------------------------------------------------
  5. #ifndef BCDLL_H
  6. #define BCDLL_H
  7.  
  8. #if defined( __cplusplus)
  9. #define CFUNC extern "C"
  10. #endif
  11.  
  12. //
  13. // Functions are exported from the DLL and imported to the calling application.
  14. // Visual C++ 4.1 does not support the __import keyword.
  15. //
  16. #if defined(BCDLL_BLD)
  17. # define BCDLL_EXP __export
  18. #else
  19. # if defined(__BORLANDC__)
  20. #  define BCDLL_EXP __import
  21. # else
  22. #  define BCDLL_EXP
  23. # endif
  24. #endif
  25.  
  26. //
  27. // Visual C++ 4.1 does not support the C++ bool type nor its predefined values.
  28. //
  29. #if defined(_MSC_VER)
  30. #  define bool BOOL
  31. #  define true TRUE
  32. #  define false FALSE
  33. #endif
  34.  
  35. CFUNC bool        BCDLL_EXP __stdcall  Message(const char * msg);
  36. CFUNC long        BCDLL_EXP __cdecl    Multiply(short s, int i);
  37. CFUNC long double BCDLL_EXP __stdcall  Average(double d, float f);
  38. CFUNC void        BCDLL_EXP __cdecl    ExceptionTest();
  39. CFUNC void        BCDLL_EXP __stdcall  UnhandledException();
  40.  
  41.  
  42. //
  43. // Note: The following versions of the test functions specifically accomodate
  44. // Visual Basic 4.0, which does not support Cdecl calling convention and does
  45. // not have an equivalent data type to long double.
  46. //
  47.  
  48. CFUNC bool        BCDLL_EXP __stdcall  VBMessage(const char * msg);
  49. CFUNC long        BCDLL_EXP __stdcall  VBMultiply(short s, int i);
  50. CFUNC double      BCDLL_EXP __stdcall  VBAverage(double d, float f);
  51. CFUNC void        BCDLL_EXP __stdcall  VBExceptionTest();
  52. CFUNC void        BCDLL_EXP __stdcall  VBUnhandledException();
  53.  
  54. #endif  // BCDLL_H
  55.