123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #include "stdafx.h"
- #include "ChatRoomClient.h"
- #include "ChatRoomClientDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- BEGIN_MESSAGE_MAP(CChatRoomClientApp, CWinApp)
- ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
- END_MESSAGE_MAP()
- CChatRoomClientApp::CChatRoomClientApp()
- {
-
- m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
-
-
- }
- CChatRoomClientApp theApp;
- BOOL CChatRoomClientApp::InitInstance()
- {
-
-
-
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
-
-
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
- CWinApp::InitInstance();
- if (!AfxSocketInit())
- {
- AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
- return FALSE;
- }
- AfxEnableControlContainer();
-
-
- CShellManager *pShellManager = new CShellManager;
-
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
-
-
-
-
-
-
-
- SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
- AfxInitRichEdit2();
- CChatRoomClientDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
-
-
- }
- else if (nResponse == IDCANCEL)
- {
-
-
- }
- else if (nResponse == -1)
- {
- TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
- TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
- }
-
- if (pShellManager != NULL)
- {
- delete pShellManager;
- }
-
-
- return FALSE;
- }
|