// FirmwareTool.h: PROJECT_NAME 应用程序的主头文件 // #pragma once #ifndef __AFXWIN_H__ #error "在包含此文件之前包含 'pch.h' 以生成 PCH" #endif #include "resource.h" // 主符号 #include "../MyLib/LOGGER/Logger.hpp" #include "../MyLib/MHashINI/MHash.hpp" void Trans_Tunc(unsigned int, EXCEPTION_POINTERS*); #define CHECKE(func) try {func;} catch(SE_Exception &e) {DisplayException(_T(__FILE__),__LINE__,_T(__FUNCTION__),_T(#func),e);} catch (CException * e) {DisplayException(_T(__FILE__),__LINE__,_T(__FUNCTION__),_T(#func),e);} catch (...){DisplayException(_T(__FILE__),__LINE__,_T(__FUNCTION__),_T(#func));} class SE_Exception { private: SE_Exception() {} unsigned int nSE; PVOID Addr; CString InfoStr; public: SE_Exception(SE_Exception& e) : nSE(e.nSE) {} SE_Exception(unsigned int n) :nSE(n) {} SE_Exception(unsigned int n, PVOID a) :nSE(n), Addr(a) {} SE_Exception(unsigned int n, PVOID a, CString& str1) :nSE(n), Addr(a), InfoStr(str1) {} ~SE_Exception() {} unsigned int getSeNumber() { return nSE; } PVOID getAddress() { return Addr; } CString& getInfoStr() { return InfoStr; } }; int DisplayException(CString File, int Line, CString Func, CString Sentence, SE_Exception& e); int DisplayException(CString File, int Line, CString Func, CString Sentence, CException* e); int DisplayException(CString File, int Line, CString Func, CString Sentence); // CFirmwareToolApp: // 有关此类的实现,请参阅 FirmwareTool.cpp // class CFirmwareToolApp : public CWinApp { public: CFirmwareToolApp(); // 重写 public: virtual BOOL InitInstance(); // 实现 DECLARE_MESSAGE_MAP() }; extern CFirmwareToolApp theApp; extern MHash myCfg1; extern Logger myLogger1; int SysLog(CString s, int channel = 0); int DbgLog(CString s, int channel = 0); int PopupMessage(CString Msg, int channel = 0); void DoEvents(); CString DeviceTypeToStr(int DeviceTypeVer);