Client.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Client.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "Client.h"
  5. #include "ClientDlg.h"
  6. // CClientApp
  7. BEGIN_MESSAGE_MAP(CClientApp, CWinApp)
  8. ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
  9. END_MESSAGE_MAP()
  10. // CClientApp construction
  11. CClientApp::CClientApp()
  12. {
  13. // TODO: add construction code here,
  14. // Place all significant initialization in InitInstance
  15. }
  16. // The one and only CClientApp object
  17. CClientApp theApp;
  18. // CClientApp initialization
  19. BOOL CClientApp::InitInstance()
  20. {
  21. // InitCommonControlsEx() is required on Windows XP if an application
  22. // manifest specifies use of ComCtl32.dll version 6 or later to enable
  23. // visual styles. Otherwise, any window creation will fail.
  24. INITCOMMONCONTROLSEX InitCtrls;
  25. InitCtrls.dwSize = sizeof(InitCtrls);
  26. // Set this to include all the common control classes you want to use
  27. // in your application.
  28. InitCtrls.dwICC = ICC_WIN95_CLASSES;
  29. InitCommonControlsEx(&InitCtrls);
  30. CWinApp::InitInstance();
  31. AfxEnableControlContainer();
  32. // Create the shell manager, in case the dialog contains
  33. // any shell tree view or shell list view controls.
  34. CShellManager *pShellManager = new CShellManager;
  35. // Standard initialization
  36. // If you are not using these features and wish to reduce the size
  37. // of your final executable, you should remove from the following
  38. // the specific initialization routines you do not need
  39. // Change the registry key under which our settings are stored
  40. // TODO: You should modify this string to be something appropriate
  41. // such as the name of your company or organization
  42. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  43. CClientDlg dlg;
  44. m_pMainWnd = &dlg;
  45. INT_PTR nResponse = dlg.DoModal();
  46. if (nResponse == IDOK)
  47. {
  48. // TODO: Place code here to handle when the dialog is
  49. // dismissed with OK
  50. }
  51. else if (nResponse == IDCANCEL)
  52. {
  53. // TODO: Place code here to handle when the dialog is
  54. // dismissed with Cancel
  55. }
  56. // Delete the shell manager created above.
  57. if (pShellManager != nullptr)
  58. {
  59. delete pShellManager;
  60. }
  61. // Since the dialog has been closed, return FALSE so that we exit the
  62. // application, rather than start the application's message pump.
  63. return FALSE;
  64. }