// 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WIFIDPC_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // WIFIDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #pragma once #ifndef WIFIDPC_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "WifiDPCX64D.lib") #else #pragma comment(lib, "WifiDPCX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "WifiDPCD.lib") #else #pragma comment(lib, "WifiDPC.lib") #endif #endif #endif #ifdef WIFIDPC_EXPORTS #define WIFIDPC_API __declspec(dllexport) #else #define WIFIDPC_API __declspec(dllimport) #endif #include "DPC.h" #include "DiosThread.h" #include "WifiOem.h" #include "SerialSCF.h" extern "C" WIFIDPC_API DPC* GetDPC(); extern "C" WIFIDPC_API void ReleaseDPC(DPC *p); class WIFIDPC_API WifiDPC : public DPC { std::string *m_pWorkpath; public: void LogInfo(string string); void LogWarn(string string); void LogError(string string); public: WifiDPC(void); virtual ~WifiDPC(void); virtual bool DpcEntry(ResDataObject &Configuration); virtual ResDataObject GetConnectionType(); virtual bool Connect(ResDataObject &Connection); virtual bool Probe(ResDataObject &HardwareInfo); virtual bool OnNotify(HANDLE ExitNotify); virtual bool SetWorkPath(const char *pWorkPath); virtual PVOID LoadLogicDevices(); virtual void UnloadLogicDevices(PVOID p); virtual bool DisConnect(); bool SendBySCF(char chChannelID, bool bStatus); //friend class SyncGen_OemDevice; //friend class ThreeAxisGyr_Oem; //friend class SyncSwitch_OemDevice; private: bool CharArrToDec(char*p,int nLength,DWORD dwRetValue); int ChartoInt(char uc); int CalChecksum(const char * cCmd, int nCmdSize); bool FormatCmd(char *cCmd, int &nSize); bool CmdtoString(const char * cCmd, int nCmdSize, string &strCmd); static PACKET_RET EventCallback(const char * pRecData, DWORD nLength, DWORD & PacketLength); typedef SCF* (*GetSCF)(); GetSCF getSCF; typedef void(*ReleaseSCF)(SCF *p); ReleaseSCF releaseSCF; SCFPacket *m_pSendPacket; SCFPacket *m_pReceivePacket; SCF *m_pSCFInstance; private: Wifi_Oem *m_pWifiFPD; HMODULE m_DllFileHandle; //ResDataObject m_ConfigObj; };