// 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WHEELDPC_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // SYNCFPDDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #ifndef ABSTRACTACQDPC_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "AbstractAcqDPCX64D.lib") #else #pragma comment(lib, "AbstractAcqDPCX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "AbstractAcqDPCD.lib") #else #pragma comment(lib, "AbstractAcqDPC.lib") #endif #endif #endif #ifdef ABSTRACTACQDPC_EXPORTS #define ABSTRACTACQDPC_API __declspec(dllexport) #else #define ABSTRACTACQDPC_API __declspec(dllimport) #endif //#include "DPC.h" // //extern "C" ABSTRACTACQDPC_API DPC* GetDPC(); //extern "C" ABSTRACTACQDPC_API void ReleaseDPC(DPC *p); // //class ABSTRACTACQDPC_API AbstractAcqDPC : public DPC //{ // std::string *m_pWorkpath; //public: // AbstractAcqDPC(void); // virtual ~AbstractAcqDPC(void); // // virtual bool DpcEntry(ResDataObject &Configuration); // // virtual ResDataObject GetConnectionType(); // // virtual bool Connect(ResDataObject &Connection); // // virtual bool Probe(ResDataObject &HardwareInfo); // // virtual bool SetWorkPath(const char *pWorkPath); // // virtual PVOID LoadLogicDevices(); // // virtual void UnloadLogicDevices(PVOID p); // // virtual bool DisConnect(); // void LogInfo(string str); //}; #include "LogicDriver.h" class ABSTRACTACQDPC_API AbstractAcqDPC : public LogicDriver { std::string *m_pWorkpath; public: AbstractAcqDPC(void); virtual ~AbstractAcqDPC(void); virtual bool DriverEntry(ResDataObject &Configuration); virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SetDriverWorkPath(const char *pWorkPath); virtual PVOID SYSTEM_CALL LoadDriver();//无根节点 virtual void SYSTEM_CALL UnloadDriver(); //actions virtual bool Connect(); virtual void DisConnect(); //virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType); virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath); virtual PVOID LoadLogicDevices(); virtual void UnloadLogicDevices(); virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count); RET_STATUS SYSTEM_CALL GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo); private: void *pObj; }; extern "C" ABSTRACTACQDPC_API DriverDPC* GetDriverDPC(); extern "C" ABSTRACTACQDPC_API void ReleaseDriverDPC(DriverDPC *p);