Advertisement
TheWhiteFang

Header Files for DLLArith

Jan 15th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. //DLLArith - These are all in the Header Files or DLLArith
  2. //Add.h
  3. #ifndef __ADD_H__
  4. #define __ADD_H__
  5.  
  6. #include "IArith.h"
  7.  
  8. class Add : public IArith
  9. {
  10. public:
  11.     // Only declare member function
  12.     int Calc(int v1, int v2);
  13. };
  14.  
  15.  
  16. #endif
  17. ------------------------------------------------------------------------------------------------------------
  18. //DLLArith.h
  19. #ifndef __DLLTEST_H__
  20. #define __DLLTEST_H__
  21.  
  22. #ifdef DLL_EXPORT
  23. #define DLLTEST_API __declspec (dllexport)
  24. #else
  25. #define DLLTEST_API __declspec (dllimport)
  26. #endif
  27.  
  28. #include "IArith.h"
  29.  
  30. extern "C"
  31. {
  32.     DLLTEST_API IArith* NewObject(int operation);
  33.     DLLTEST_API void DelObject(IArith *pObject);
  34. }
  35.  
  36. #endif
  37. --------------------------------------------------------------------------------------------------------------
  38. //IArith.h
  39. #ifndef __IARITH_H__
  40. #define __IARITH_H__
  41.  
  42. class IArith
  43. {
  44. public:
  45.     virtual int Calc(int v1, int v2) = 0;
  46. };
  47.  
  48.  
  49. #endif
  50. -------------------------------------------------------------------------------------------------------------
  51. // subtract.h
  52. #ifndef __SUBTRACT_H__
  53. #define __SUBTRACT_H__
  54.  
  55. #include "IArith.h"
  56.  
  57. class Subtract : public IArith
  58. {
  59. public:
  60.     // Only declare member function
  61.     int Calc(int v1, int v2);
  62. };
  63. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement