提交 | 用户 | age
|
0ed438
|
1 |
|
418cb3
|
2 |
// MultiTerminal2.h: MultiTerminal2 应用程序的主头文件
|
0ed438
|
3 |
//
|
Q |
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"
|
418cb3
|
14 |
|
0ed438
|
15 |
void Trans_Tunc(unsigned int, EXCEPTION_POINTERS*);
|
Q |
16 |
#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));}
|
|
17 |
class SE_Exception
|
|
18 |
{
|
|
19 |
private:
|
|
20 |
SE_Exception() {}
|
|
21 |
unsigned int nSE;
|
|
22 |
PVOID Addr;
|
|
23 |
CString InfoStr;
|
|
24 |
public:
|
|
25 |
SE_Exception(SE_Exception& e) : nSE(e.nSE) {}
|
|
26 |
SE_Exception(unsigned int n) :nSE(n) {}
|
|
27 |
SE_Exception(unsigned int n, PVOID a) :nSE(n), Addr(a) {}
|
|
28 |
SE_Exception(unsigned int n, PVOID a, CString &str1) :nSE(n), Addr(a), InfoStr(str1) {}
|
|
29 |
|
|
30 |
~SE_Exception() {}
|
|
31 |
unsigned int getSeNumber() { return nSE; }
|
|
32 |
PVOID getAddress() { return Addr; }
|
|
33 |
CString & getInfoStr() { return InfoStr; }
|
|
34 |
};
|
|
35 |
int DisplayException(CString File, int Line, CString Func, CString Sentence, SE_Exception &e);
|
|
36 |
int DisplayException(CString File, int Line, CString Func, CString Sentence, CException *e);
|
|
37 |
int DisplayException(CString File, int Line, CString Func, CString Sentence);
|
|
38 |
|
|
39 |
int SaveMyConfig();
|
|
40 |
int LoadMyConfig();
|
|
41 |
|
418cb3
|
42 |
int SysLog(CString s, int channel = 0);
|
Q |
43 |
int DbgLog(CString s, int channel = 0);
|
|
44 |
|
0ed438
|
45 |
int PopupMessage(CString s, int channel = 0);
|
Q |
46 |
void DoEvents();
|
|
47 |
|
|
48 |
extern MHash MyCfg1;
|
418cb3
|
49 |
extern Logger myLogger1;
|
Q |
50 |
|
0ed438
|
51 |
|
Q |
52 |
// CMTerm1App:
|
418cb3
|
53 |
// 有关此类的实现,请参阅 MultiTerminal2.cpp
|
0ed438
|
54 |
//
|
Q |
55 |
|
|
56 |
class CMTerm1App : public CWinAppEx
|
|
57 |
{
|
|
58 |
public:
|
|
59 |
CMTerm1App() noexcept;
|
418cb3
|
60 |
CMultiDocTemplate* pDocTemplate;
|
Q |
61 |
|
|
62 |
CMultiDocTemplate * m_pLdsViewTemplate;
|
|
63 |
CMultiDocTemplate * m_pBldViewTemplate;
|
|
64 |
CMultiDocTemplate * m_pBnlViewTemplate;
|
|
65 |
CMultiDocTemplate * m_pCtrlViewTemplate;
|
|
66 |
CMultiDocTemplate * m_pProgViewTemplate;
|
|
67 |
|
|
68 |
CMultiDocTemplate * m_pCoilViewTemplate;
|
|
69 |
CMultiDocTemplate * m_pDataViewTemplate;
|
|
70 |
|
|
71 |
CMultiDocTemplate * m_pCommDevViewTemplate;
|
|
72 |
|
|
73 |
|
|
74 |
CMultiDocTemplate * m_pNewDocTemplate;
|
0ed438
|
75 |
|
Q |
76 |
|
|
77 |
// 重写
|
|
78 |
public:
|
|
79 |
virtual BOOL InitInstance();
|
|
80 |
virtual int ExitInstance();
|
|
81 |
|
|
82 |
// 实现
|
418cb3
|
83 |
bool m_bHiColorIcons;
|
0ed438
|
84 |
|
Q |
85 |
afx_msg void OnAppAbout();
|
|
86 |
DECLARE_MESSAGE_MAP()
|
418cb3
|
87 |
afx_msg void OnFileNew();
|
Q |
88 |
afx_msg void OnComunicationSet();
|
|
89 |
afx_msg void OnEnvSet();
|
0ed438
|
90 |
};
|
Q |
91 |
|
|
92 |
extern CMTerm1App theApp;
|
|
93 |
|
418cb3
|
94 |
//class CAnsiParser;
|
Q |
95 |
//class CDataParser1;
|
|
96 |
//class KLink;
|
|
97 |
//class CSerialCom;
|
|
98 |
//class HvSerialPort;
|
0ed438
|
99 |
|
418cb3
|
100 |
//extern CAnsiParser MyAnsiParser1;
|
Q |
101 |
//extern CDataParser1 MyDataParser1;
|
|
102 |
//extern KLink MyKLink1;
|
0ed438
|
103 |
// extern CSerialCom MySerialCom1;
|
418cb3
|
104 |
//extern HvSerialPort myHvSerialPort1;
|
0ed438
|
105 |
|
Q |
106 |
|
418cb3
|
107 |
CString & intToString(int num,int digit=0);
|
0ed438
|
108 |
CString & intToBinString(int num, int digits = 8);
|
Q |
109 |
|
|
110 |
int get_com_name(CString comx, CString &namebuf);
|
418cb3
|
111 |
|