123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #pragma once
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 MDPCFPDDEMO_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // MDPCFPDDEMO_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifdef MDPCFPDDEMO_EXPORTS
- #define MDPCFPDDEMO_API __declspec(dllexport)
- #define MDPCFPDDEMO_C_API extern "C" __declspec(dllexport)
- #else
- #define MDPCFPDDEMO_API __declspec(dllimport)
- #define MDPCFPDDEMO_C_API __declspec(dllimport)
- #endif
- #ifndef MDPCFPDDEMO_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "MdpcFpdDemoX64D.lib")
- #else
- #pragma comment(lib, "MdpcFpdDemoX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "MdpcFpdDemoD.lib")
- #else
- #pragma comment(lib, "MdpcFpdDemo.lib")
- #endif
- #endif
- #endif
- #include "LogicDevice.h"
- #include "ResDataObject.h"
- #include "MultiDPC.h"
- MDPCFPDDEMO_C_API DriverDPC* GetDriverDPC();
- MDPCFPDDEMO_C_API void ReleaseDriverDPC(DriverDPC *p);
- // 此类是从 MDPCFPDDemo.dll 导出的
- class MDPCFPDDEMO_API CMDPCFPDDemo : public MultiDPC
- {
- ResDataObject m_DPCs_Config;
- ResDataObject m_FullDriverConfig;
- std::string *m_pWorkpath;
- std::string *m_strConfigPath; //配置文件路径
- //GUID->KEY->Driver
- map<string, map<string, LogicDriver*>> *m_pDriverDPCs;
- bool LoadExistDPCs();
- bool AddExistDPC(const char *pszIdentifystr);
- public:
- CMDPCFPDDemo(void);
- ~CMDPCFPDDemo(void);
- //正常调入
- virtual bool DriverEntry(ResDataObject &Configuration);
- //正常调入
- virtual bool Driver_Probe(ResDataObject &HardwareInfo);
- //正常调入
- virtual bool SYSTEM_CALL SetDriverWorkPath(const char * PARAM_IN pWorkPath);
- //正常调入
- virtual void SYSTEM_CALL UnloadDriver();
- //正常调入
- virtual bool Connect();
- virtual void DisConnect();
- //正常调入
- virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
- virtual RET_STATUS DATA_ACTION AddDPC(const char *pGUID, const char *pszIdentifystr);
- virtual RET_STATUS DATA_ACTION DelDPC(const char *pGUID, const char *pszIdentifystr);
- virtual void DATA_ACTION FirstAction();
- };
|