-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADSBViewer.cpp
75 lines (61 loc) · 2.03 KB
/
ADSBViewer.cpp
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
#include "pch.h"
#include "framework.h"
#include "afxwinappex.h"
#include "afxdialogex.h"
#include "ADSBViewer.h"
#include "MainFrm.h"
#include "AboutDialog.h"
#include "ADSBViewerDoc.h"
#include "ADSBViewerView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CADSBViewerApp
BEGIN_MESSAGE_MAP(CADSBViewerApp, CWinApp)
ON_COMMAND(ID_APP_ABOUT, &CADSBViewerApp::OnAppAbout)
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, &CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, &CWinApp::OnFileOpen)
END_MESSAGE_MAP()
// CADSBViewerApp construction
CADSBViewerApp::CADSBViewerApp() noexcept
{
SetAppID(_T("JWS Soft/Hard.ADSBViewer.Viewer.1.0.1"));
}
// The one and only CADSBViewerApp object
CADSBViewerApp theApp;
// CADSBViewerApp initialization
BOOL CADSBViewerApp::InitInstance()
{
CWinApp::InitInstance();
EnableTaskbarInteraction(FALSE);
// Change the registry key under which our settings are stored
SetRegistryKey(_T("ADS-B Viewer, JWS Soft/Hard"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CADSBViewerDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CADSBViewerView));
if (!pDocTemplate) return FALSE;
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo)) return FALSE;
// The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
// App command to run the dialog
void CADSBViewerApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}