Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //DLLArith - These are all in the Header Files or DLLArith
- //Add.h
- #ifndef __ADD_H__
- #define __ADD_H__
- #include "IArith.h"
- class Add : public IArith
- {
- public:
- // Only declare member function
- int Calc(int v1, int v2);
- };
- #endif
- ------------------------------------------------------------------------------------------------------------
- //DLLArith.h
- #ifndef __DLLTEST_H__
- #define __DLLTEST_H__
- #ifdef DLL_EXPORT
- #define DLLTEST_API __declspec (dllexport)
- #else
- #define DLLTEST_API __declspec (dllimport)
- #endif
- #include "IArith.h"
- extern "C"
- {
- DLLTEST_API IArith* NewObject(int operation);
- DLLTEST_API void DelObject(IArith *pObject);
- }
- #endif
- --------------------------------------------------------------------------------------------------------------
- //IArith.h
- #ifndef __IARITH_H__
- #define __IARITH_H__
- class IArith
- {
- public:
- virtual int Calc(int v1, int v2) = 0;
- };
- #endif
- -------------------------------------------------------------------------------------------------------------
- // subtract.h
- #ifndef __SUBTRACT_H__
- #define __SUBTRACT_H__
- #include "IArith.h"
- class Subtract : public IArith
- {
- public:
- // Only declare member function
- int Calc(int v1, int v2);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement