// 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DETECTORCLI_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // DETECTORCLI_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #ifndef DETECTORCLI_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "DetectorCLIX64D.lib") #else #pragma comment(lib, "DetectorCLIX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "DetectorCLID.lib") #else #pragma comment(lib, "DetectorCLI.lib") #endif #endif #endif #ifdef DETECTORCLI_EXPORTS #define DETECTORCLI_API __declspec(dllexport) #define DETECTORCLI_C_API extern "C" __declspec(dllexport) #else #define DETECTORCLI_API __declspec(dllimport) #define DETECTORCLI_C_API extern "C" __declspec(dllimport) #endif #include "DiosConsoleScript.h" class CommonLogicClient; // 此类是从 DetectorCLI.dll 导出的 class DETECTORCLI_API CDetectorCLI : public DiosConsoleScript { public: CDetectorCLI(void); virtual ~CDetectorCLI(); // TODO: 在此添加您的方法。 virtual void Help(); //inputcmd : helloworld 2020 Joy_Derk //[0]:helloworld //[1]:2020 //[2]:Joy_Derk //[0]:command,[1]:P1,[2]:P2... virtual DCS_RET Command(ResDataObject &Req); DCS_RET ConnectDemoFD(ResDataObject &Req); DCS_RET DisconnectDemoFD(ResDataObject &Req); DCS_RET NewModelTest(ResDataObject &Req); }; DETECTORCLI_C_API DiosConsoleScript* LoadDCS();//user要集成此功能 DETECTORCLI_C_API void UnLoadDCS(DiosConsoleScript* pDcs);