提交 | 用户 | age
|
418cb3
|
1 |
|
Q |
2 |
// ConfigTool.h: ConfigTool 应用程序的主头文件
|
|
3 |
//
|
|
4 |
#pragma once
|
|
5 |
|
|
6 |
#ifndef __AFXWIN_H__
|
|
7 |
#error "include 'pch.h' before including this file for PCH"
|
|
8 |
#endif
|
|
9 |
|
|
10 |
#include "resource.h" // 主符号
|
|
11 |
|
|
12 |
#include "../mylib/LOGGER/Logger.hpp"
|
|
13 |
#include "../MyLib/MHashINI/MHash.hpp"
|
|
14 |
|
|
15 |
// CConfigToolApp:
|
|
16 |
// 有关此类的实现,请参阅 ConfigTool.cpp
|
|
17 |
//
|
|
18 |
|
|
19 |
class CConfigToolApp : public CWinApp
|
|
20 |
{
|
|
21 |
public:
|
|
22 |
CConfigToolApp() noexcept;
|
|
23 |
|
|
24 |
|
|
25 |
// 重写
|
|
26 |
public:
|
|
27 |
virtual BOOL InitInstance();
|
|
28 |
virtual int ExitInstance();
|
|
29 |
|
|
30 |
// 实现
|
|
31 |
afx_msg void OnAppAbout();
|
|
32 |
DECLARE_MESSAGE_MAP()
|
|
33 |
};
|
|
34 |
|
|
35 |
extern CConfigToolApp theApp;
|
|
36 |
|
|
37 |
|
|
38 |
void Trans_Tunc(unsigned int, EXCEPTION_POINTERS*);
|
|
39 |
#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));}
|
|
40 |
class SE_Exception
|
|
41 |
{
|
|
42 |
private:
|
|
43 |
SE_Exception() {}
|
|
44 |
unsigned int nSE;
|
|
45 |
PVOID Addr;
|
|
46 |
CString InfoStr;
|
|
47 |
public:
|
|
48 |
SE_Exception(SE_Exception& e) : nSE(e.nSE) {}
|
|
49 |
SE_Exception(unsigned int n) :nSE(n) {}
|
|
50 |
SE_Exception(unsigned int n, PVOID a) :nSE(n), Addr(a) {}
|
|
51 |
SE_Exception(unsigned int n, PVOID a, CString &str1) :nSE(n), Addr(a), InfoStr(str1) {}
|
|
52 |
|
|
53 |
~SE_Exception() {}
|
|
54 |
unsigned int getSeNumber() { return nSE; }
|
|
55 |
PVOID getAddress() { return Addr; }
|
|
56 |
CString & getInfoStr() { return InfoStr; }
|
|
57 |
};
|
|
58 |
int DisplayException(CString File, int Line, CString Func, CString Sentence, SE_Exception &e);
|
|
59 |
int DisplayException(CString File, int Line, CString Func, CString Sentence, CException *e);
|
|
60 |
int DisplayException(CString File, int Line, CString Func, CString Sentence);
|
|
61 |
|
|
62 |
int SaveMyConfig();
|
|
63 |
int LoadMyConfig();
|
|
64 |
|
|
65 |
int SysLog(CString s, int channel = 0);
|
|
66 |
int DbgLog(CString s, int channel = 0);
|
|
67 |
|
|
68 |
int PopupMessage(CString s, int channel = 0);
|
|
69 |
void DoEvents();
|
|
70 |
|
|
71 |
extern MHash MyCfg1;
|
|
72 |
extern Logger myLogger1;
|
|
73 |
extern MHash DeviceList;
|
|
74 |
|
|
75 |
CString& FormatHex(void * databuf, int nSize);
|