Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
2.4 KiB

  1. //
  2. // Application Verifier UI
  3. // Copyright (c) Microsoft Corporation, 2001
  4. //
  5. //
  6. //
  7. // module: appverif.cpp
  8. // author: DMihai
  9. // created: 02/22/2001
  10. //
  11. // Description:
  12. //
  13. // Defines the class behaviors for the application.
  14. //
  15. #include "stdafx.h"
  16. #include "appverif.h"
  17. #include "AVSheet.h"
  18. #include "AVGlobal.h"
  19. #include "AVUtil.h"
  20. #include "CmdLine.h"
  21. #ifdef _DEBUG
  22. #define new DEBUG_NEW
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CAppverifApp
  28. BEGIN_MESSAGE_MAP(CAppverifApp, CWinApp)
  29. //{{AFX_MSG_MAP(CAppverifApp)
  30. // NOTE - the ClassWizard will add and remove mapping macros here.
  31. // DO NOT EDIT what you see in these blocks of generated code!
  32. //}}AFX_MSG
  33. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CAppverifApp construction
  37. CAppverifApp::CAppverifApp()
  38. {
  39. // TODO: add construction code here,
  40. // Place all significant initialization in InitInstance
  41. }
  42. /////////////////////////////////////////////////////////////////////////////
  43. // The one and only CAppverifApp object
  44. CAppverifApp theApp;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CAppverifApp initialization
  47. BOOL CAppverifApp::InitInstance()
  48. {
  49. DWORD dwExitCode;
  50. static CAppverifSheet dlg;
  51. AfxEnableControlContainer();
  52. dwExitCode = AV_EXIT_CODE_SUCCESS;
  53. //
  54. // Initialize the global data
  55. //
  56. if( AVInitalizeGlobalData() == FALSE )
  57. {
  58. AVMesssageFromResource( IDS_CANNOT_INITIALIZE_DATA );
  59. dwExitCode = AV_EXIT_CODE_ERROR;
  60. goto ExitApp;
  61. }
  62. m_pszAppName = _tcsdup( (LPCTSTR)g_strAppName );
  63. //
  64. // Check for command line arguments
  65. //
  66. if( __argc > 1 )
  67. {
  68. //
  69. // Run just in command line mode
  70. //
  71. _tsetlocale( LC_ALL, _T( ".OCP" ) );
  72. g_bCommandLineMode = TRUE;
  73. dwExitCode = CmdLineExecute( __argc, __targv );
  74. goto ExitApp;
  75. }
  76. else
  77. {
  78. //
  79. // GUI mode - free the console
  80. //
  81. FreeConsole();
  82. //
  83. // Display the wizard
  84. //
  85. m_pMainWnd = &dlg;
  86. dlg.DoModal();
  87. }
  88. ExitApp:
  89. //
  90. // All done, exit the app
  91. //
  92. exit( dwExitCode );
  93. return FALSE;
  94. }