LAPTOP-SNT8I5JK\Boounion
2025-05-13 4d9ee1abb3290f468fe30e048be211bb7fa8cf84
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
 
// GangBond2860Emulator.cpp : ¶¨ÒåÓ¦ÓóÌÐòµÄÀàÐÐΪ¡£
//
 
#include "stdafx.h"
#include "GangBond2860Emulator.h"
#include "GangBond2860EmulatorDlg.h"
#include "HmTab.h"
 
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
 
 
#define VERSION_NUMBER        1
#define VERSION_NAME        _T("1.0.2")
 
// CGangBond2860EmulatorApp
 
BEGIN_MESSAGE_MAP(CGangBond2860EmulatorApp, CWinApp)
    ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
 
 
// CGangBond2860EmulatorApp ¹¹Ôì
 
CGangBond2860EmulatorApp::CGangBond2860EmulatorApp()
{
    // Ö§³ÖÖØÐÂÆô¶¯¹ÜÀíÆ÷
    m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
 
    // TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ôì´úÂ룬
    // ½«ËùÓÐÖØÒªµÄ³õʼ»¯·ÅÖÃÔÚ InitInstance ÖÐ
 
    // °æ±¾ºÅ¼°°æ±¾Ãû³Æ
    m_nVersionNumber = VERSION_NUMBER;
    m_strVersionName = VERSION_NAME;
}
 
 
// Î¨Ò»µÄÒ»¸ö CGangBond2860EmulatorApp ¶ÔÏó
 
CGangBond2860EmulatorApp theApp;
 
 
// CGangBond2860EmulatorApp ³õʼ»¯
 
BOOL CGangBond2860EmulatorApp::InitInstance()
{
    // Èç¹ûÒ»¸öÔËÐÐÔÚ Windows XP ÉϵÄÓ¦ÓóÌÐòÇåµ¥Ö¸¶¨Òª
    // Ê¹ÓàComCtl32.dll °æ±¾ 6 »ò¸ü¸ß°æ±¾À´ÆôÓÿÉÊÓ»¯·½Ê½£¬
    //ÔòÐèÒª InitCommonControlsEx()¡£  ·ñÔò£¬½«ÎÞ·¨´´½¨´°¿Ú¡£
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    // ½«ËüÉèÖÃΪ°üÀ¨ËùÓÐÒªÔÚÓ¦ÓóÌÐòÖÐʹÓõÄ
    // ¹«¹²¿Ø¼þÀà¡£
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
 
    CWinApp::InitInstance();
 
 
    AfxEnableControlContainer();
 
    // ´´½¨ shell ¹ÜÀíÆ÷£¬ÒÔ·À¶Ô»°¿ò°üº¬
    // ÈκΠshell Ê÷ÊÓͼ¿Ø¼þ»ò shell ÁбíÊÓͼ¿Ø¼þ¡£
    CShellManager *pShellManager = new CShellManager;
 
    // ¼¤»î¡°Windows Native¡±ÊÓ¾õ¹ÜÀíÆ÷£¬ÒÔ±ãÔÚ MFC ¿Ø¼þÖÐÆôÓÃÖ÷Ìâ
    CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
 
    // ±ê×¼³õʼ»¯
    // Èç¹ûδʹÓÃÕâЩ¹¦Äܲ¢Ï£Íû¼õС
    // ×îÖÕ¿ÉÖ´ÐÐÎļþµÄ´óС£¬ÔòÓ¦ÒÆ³ýÏÂÁÐ
    // ²»ÐèÒªµÄÌØ¶¨³õʼ»¯Àý³Ì
    // ¸ü¸ÄÓÃÓÚ´æ´¢ÉèÖõÄ×¢²á±íÏî
    // TODO: Ó¦Êʵ±Ð޸ĸÃ×Ö·û´®£¬
    // ÀýÈçÐÞ¸ÄΪ¹«Ë¾»ò×éÖ¯Ãû
    SetRegistryKey(_T("Ó¦ÓóÌÐòÏòµ¼Éú³ÉµÄ±¾µØÓ¦ÓóÌÐò"));
 
 
    // ±¾³ÌÐòÎļþĿ¼
    TCHAR sDrive[_MAX_DRIVE];
    TCHAR sDir[_MAX_DIR];
    TCHAR sFilename[_MAX_FNAME], sAppFilename[_MAX_FNAME];
    TCHAR sExt[_MAX_EXT];
    GetModuleFileName(AfxGetInstanceHandle(), sAppFilename, _MAX_FNAME);
    _tsplitpath_s(sAppFilename, sDrive, sDir, sFilename, sExt);
    m_strAppDir = CString(sDrive) + CString(sDir);
    m_strAppFile = CString(sFilename);
 
 
 
    // ¿Ø¼þ×¢²á
    CHmTab::RegisterWndClass();
 
 
    // ³õʼ»¯BEQ¿â
    BEQ_Initialize();
 
 
    CGangBond2860EmulatorDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: ÔÚ´Ë·ÅÖô¦ÀíºÎʱÓÃ
        //  ¡°È·¶¨¡±À´¹Ø±Õ¶Ô»°¿òµÄ´úÂë
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: ÔÚ´Ë·ÅÖô¦ÀíºÎʱÓÃ
        //  ¡°È¡Ïû¡±À´¹Ø±Õ¶Ô»°¿òµÄ´úÂë
    }
    else if (nResponse == -1)
    {
        TRACE(traceAppMsg, 0, "¾¯¸æ: ¶Ô»°¿ò´´½¨Ê§°Ü£¬Ó¦ÓóÌÐò½«ÒâÍâÖÕÖ¹¡£\n");
        TRACE(traceAppMsg, 0, "¾¯¸æ: Èç¹ûÄúÔÚ¶Ô»°¿òÉÏʹÓàMFC ¿Ø¼þ£¬ÔòÎÞ·¨ #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS¡£\n");
    }
 
    // É¾³ýÉÏÃæ´´½¨µÄ shell ¹ÜÀíÆ÷¡£
    if (pShellManager != NULL)
    {
        delete pShellManager;
    }
 
    // ÓÉÓÚ¶Ô»°¿òÒѹرգ¬ËùÒÔ½«·µ»Ø FALSE ÒÔ±ãÍ˳öÓ¦ÓóÌÐò£¬
    //  ¶ø²»ÊÇÆô¶¯Ó¦ÓóÌÐòµÄÏûÏ¢±Ã¡£
    return FALSE;
}
 
int CGangBond2860EmulatorApp::ExitInstance()
{
    BEQ_Term();
 
    return CWinApp::ExitInstance();
}