-
Notifications
You must be signed in to change notification settings - Fork 2
/
StdAfx.h
105 lines (88 loc) · 3.03 KB
/
StdAfx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__6D63CA46_F2CF_40D3_B925_F1C75DFBFC28__INCLUDED_)
#define AFX_STDAFX_H__6D63CA46_F2CF_40D3_B925_F1C75DFBFC28__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxwinappex.h> // Added 12-31-2020 to make "folder browse" component of the preferences dialog work
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#define ATLTRACE6 m_DebugFile.Dump
#define USE_DEBUGDUMP extern CDebugDump m_DebugFile;
#include "afxdialogex.h"
#include "afxeditbrowsectrl.h"
#include <algorithm>
#include <Assert.h>
#include <fstream>
#include <filesystem>
#include <iostream>
#include <io.h>
#include <json/json.h>
#include <map>
#include <mutex>
#include <process.h>
#include <regex>
#include <sstream>
#include <string>
#include <string_view>
#include <time.h>
#include <vector>
#include <WinBase.h>
#include <winternl.h>
#include <wrl/client.h> //graphics card info for MachineInfo.cpp
//Without the following 2 macros the date library spits out 50+ errors about min and max being undefined.
#undef max
#undef min
#include <date/date.h> //Should likely move this to StdAfx.h, but I'm not sure if I can because of the macro issue.
using namespace date;
using namespace std::chrono;
#pragma comment(lib, "DXGI.lib") //graphics card info
#pragma comment (lib, "OneCore.lib") //Used to enumerate COM ports
using std::string;
using std::vector;
using std::map;
using std::string_view;
using std::to_string;
namespace SL
{
inline void OutputDebug(string OutputString){
OutputDebugString(OutputString.c_str());
OutputDebugString("\n");
}
//file name string cleaner helper functions
inline void RemoveExtension(string& inputString) {
size_t pos = inputString.find(".exe");
inputString.replace(pos, inputString.size(), "");
}
inline void RemovePath(string& inputString) {
size_t pos = inputString.rfind("\\");
inputString.replace(0, pos + 1, "");
}
inline void RemoveFileNameFromPath(string& inputString) {
size_t pos = inputString.rfind("\\");
inputString.replace(pos + 1, inputString.size(), "");
}
inline void RemoveSpaces(string& inputString) {
size_t pos;
while ((pos = inputString.find(" ")) != string::npos) {
inputString.replace(pos, 1, "");
}
}
}
#if _DEBUG
#define DEBUG_PRINT(x) SL::OutputDebug(x);
#else
#define DEBUG_PRINT(x)
#endif
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__6D63CA46_F2CF_40D3_B925_F1C75DFBFC28__INCLUDED_)