提交 | 用户 | age
|
0ed438
|
1 |
|
Q |
2 |
// MultiTerminal2.h: MultiTerminal2 应用程序的主头文件
|
|
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 |
void Trans_Tunc(unsigned int, EXCEPTION_POINTERS*);
|
|
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 |
|
|
42 |
int SysLog(CString s, int channel = 0);
|
|
43 |
int DbgLog(CString s, int channel = 0);
|
|
44 |
|
|
45 |
int PopupMessage(CString s, int channel = 0);
|
|
46 |
void DoEvents();
|
|
47 |
|
|
48 |
extern MHash MyCfg1;
|
|
49 |
extern Logger myLogger1;
|
|
50 |
|
|
51 |
|
|
52 |
// CMTerm2App:
|
|
53 |
// 有关此类的实现,请参阅 MultiTerminal2.cpp
|
|
54 |
//
|
|
55 |
|
|
56 |
class CMTerm2App : public CWinAppEx
|
|
57 |
{
|
|
58 |
public:
|
|
59 |
CMTerm2App() noexcept;
|
|
60 |
CMultiDocTemplate* pDocTemplate;
|
|
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;
|
|
75 |
|
|
76 |
|
|
77 |
// 重写
|
|
78 |
public:
|
|
79 |
virtual BOOL InitInstance();
|
|
80 |
virtual int ExitInstance();
|
|
81 |
|
|
82 |
// 实现
|
|
83 |
afx_msg void OnAppAbout();
|
|
84 |
DECLARE_MESSAGE_MAP()
|
|
85 |
afx_msg void OnFileNew();
|
|
86 |
afx_msg void OnComunicationSet();
|
|
87 |
afx_msg void OnEnvSet();
|
|
88 |
};
|
|
89 |
|
|
90 |
extern CMTerm2App theApp;
|
|
91 |
|
|
92 |
//class CAnsiParser;
|
|
93 |
//class CDataParser1;
|
|
94 |
//class KLink;
|
|
95 |
//class CSerialCom;
|
|
96 |
//class HvSerialPort;
|
|
97 |
|
|
98 |
//extern CAnsiParser MyAnsiParser1;
|
|
99 |
//extern CDataParser1 MyDataParser1;
|
|
100 |
//extern KLink MyKLink1;
|
|
101 |
// extern CSerialCom MySerialCom1;
|
|
102 |
//extern HvSerialPort myHvSerialPort1;
|
|
103 |
|
|
104 |
|
|
105 |
CString & intToString(int num);
|
|
106 |
CString & intToBinString(int num, int digits = 8);
|
|
107 |
|
|
108 |
int get_com_name(CString comx, CString &namebuf);
|
|
109 |
|