1 |
// h8server.cpp : Defines the class behaviors for the application.
|
2 |
//
|
3 |
|
4 |
#include "stdafx.h"
|
5 |
#include "h8server.h"
|
6 |
#include "h8serverDlg.h"
|
7 |
|
8 |
#ifdef _DEBUG
|
9 |
#define new DEBUG_NEW
|
10 |
#endif
|
11 |
|
12 |
|
13 |
// Ch8serverApp
|
14 |
|
15 |
BEGIN_MESSAGE_MAP(Ch8serverApp, CWinApp)
|
16 |
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
17 |
END_MESSAGE_MAP()
|
18 |
|
19 |
|
20 |
// Ch8serverApp construction
|
21 |
|
22 |
Ch8serverApp::Ch8serverApp()
|
23 |
{
|
24 |
// TODO: add construction code here,
|
25 |
// Place all significant initialization in InitInstance
|
26 |
}
|
27 |
|
28 |
|
29 |
// The one and only Ch8serverApp object
|
30 |
|
31 |
Ch8serverApp theApp;
|
32 |
|
33 |
|
34 |
// Ch8serverApp initialization
|
35 |
|
36 |
BOOL Ch8serverApp::InitInstance()
|
37 |
{
|
38 |
// InitCommonControls() is required on Windows XP if an application
|
39 |
// manifest specifies use of ComCtl32.dll version 6 or later to enable
|
40 |
// visual styles. Otherwise, any window creation will fail.
|
41 |
InitCommonControls();
|
42 |
|
43 |
CWinApp::InitInstance();
|
44 |
|
45 |
if (!AfxSocketInit())
|
46 |
{
|
47 |
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
|
48 |
return FALSE;
|
49 |
}
|
50 |
|
51 |
AfxEnableControlContainer();
|
52 |
|
53 |
// Standard initialization
|
54 |
// If you are not using these features and wish to reduce the size
|
55 |
// of your final executable, you should remove from the following
|
56 |
// the specific initialization routines you do not need
|
57 |
// Change the registry key under which our settings are stored
|
58 |
// TODO: You should modify this string to be something appropriate
|
59 |
// such as the name of your company or organization
|
60 |
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
|
61 |
|
62 |
Ch8serverDlg dlg;
|
63 |
m_pMainWnd = &dlg;
|
64 |
INT_PTR nResponse = dlg.DoModal();
|
65 |
if (nResponse == IDOK)
|
66 |
{
|
67 |
// TODO: Place code here to handle when the dialog is
|
68 |
// dismissed with OK
|
69 |
}
|
70 |
else if (nResponse == IDCANCEL)
|
71 |
{
|
72 |
// TODO: Place code here to handle when the dialog is
|
73 |
// dismissed with Cancel
|
74 |
}
|
75 |
|
76 |
// Since the dialog has been closed, return FALSE so that we exit the
|
77 |
// application, rather than start the application's message pump.
|
78 |
return FALSE;
|
79 |
}
|