123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 SHAREMEMORY_TYPE_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // SHAREMEMORY_TYPE_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifndef SHAREMEMORY_TYPE_EXPORTS
- #ifdef WIN_64BIT
- #ifdef _DEBUG
- #pragma comment(lib, "ShareMemory_TypeX64D.lib")
- #else
- #pragma comment(lib, "ShareMemory_TypeX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "ShareMemory_TypeD.lib")
- #else
- #pragma comment(lib, "ShareMemory_Type.lib")
- #endif
- #endif
- #endif
- #ifdef SHAREMEMORY_TYPE_EXPORTS
- #define SHAREMEMORY_TYPE_API __declspec(dllexport)
- #define SHAREMEMORY_TYPE_C_API extern "C" __declspec(dllexport)
- #else
- #define SHAREMEMORY_TYPE_API __declspec(dllimport)
- #define SHAREMEMORY_TYPE_C_API extern "C" __declspec(dllimport)
- #endif
- #include"ShareMemory_Common.h"
- // 此类是从 ShareMemory_Type.dll 导出的
- class SHAREMEMORY_TYPE_API CShareMemory_Type {
- BYTE m_type;
- unsigned int m_BlockDataSize;
- unsigned int m_BlockCount;
- unsigned int m_BlockHeadSize;
- SHRAREMEMBLOCKID m_SMBid;
- SMClientID m_SMCid;
- public:
- CShareMemory_Type(BYTE type, unsigned int BlockDataSize, unsigned int BlockCount, unsigned int BlockHeadSize);
- ~CShareMemory_Type();
- bool GetBlockData(DWORD SMBid, LPVOID & buff, DWORD & size);
- };
- extern SHAREMEMORY_TYPE_API int nShareMemory_Type;
- SHAREMEMORY_TYPE_API int fnShareMemory_Type(void);
|