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.

190 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. evtview.cpp
  5. Abstract:
  6. Defines the class behaviors for the application.
  7. Author:
  8. Sivaprasad Padisetty (sivapad) 6/25/97
  9. Revision History:
  10. --*/
  11. #include "stdafx.h"
  12. #include "evtview.h"
  13. #include "MainFrm.h"
  14. #include "ChildFrm.h"
  15. #include "Doc.h"
  16. #include "ListView.h"
  17. #include "globals.h"
  18. #include "getevent.h"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CEvtviewApp
  26. BEGIN_MESSAGE_MAP(CEvtviewApp, CWinApp)
  27. //{{AFX_MSG_MAP(CEvtviewApp)
  28. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  29. // NOTE - the ClassWizard will add and remove mapping macros here.
  30. // DO NOT EDIT what you see in these blocks of generated code!
  31. //}}AFX_MSG_MAP
  32. // Standard file based document commands
  33. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  34. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  35. // Standard print setup command
  36. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  37. END_MESSAGE_MAP()
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CEvtviewApp construction
  40. CEvtviewApp::CEvtviewApp()
  41. {
  42. // TODO: add construction code here,
  43. // Place all significant initialization in InitInstance
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // The one and only CEvtviewApp object
  47. CEvtviewApp theApp;
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CEvtviewApp initialization
  50. BOOL CEvtviewApp::InitInstance()
  51. {
  52. // Standard initialization
  53. // If you are not using these features and wish to reduce the size
  54. // of your final executable, you should remove from the following
  55. // the specific initialization routines you do not need.
  56. #ifdef _AFXDLL
  57. Enable3dControls(); // Call this when using MFC in a shared DLL
  58. #else
  59. Enable3dControlsStatic(); // Call this when linking to MFC statically
  60. #endif
  61. LoadStdProfileSettings(); // Load standard INI file options (including MRU)
  62. // Register the application's document templates. Document templates
  63. // serve as the connection between documents, frame windows and views.
  64. CMultiDocTemplate* pDocTemplate;
  65. pDocTemplate = new CMultiDocTemplate(
  66. IDR_EVTVIETYPE,
  67. RUNTIME_CLASS(CEvtviewDoc),
  68. RUNTIME_CLASS(CChildFrame), // custom MDI child frame
  69. RUNTIME_CLASS(CEventListView));
  70. AddDocTemplate(pDocTemplate);
  71. // c`reate main MDI Frame window
  72. CMainFrame* pMainFrame = new CMainFrame;
  73. if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  74. return FALSE;
  75. m_pMainWnd = pMainFrame;
  76. // Parse command line for standard shell commands, DDE, file open
  77. CCommandLineInfo cmdInfo;
  78. ParseCommandLine(cmdInfo);
  79. /*
  80. // Dispatch commands specified on the command line
  81. if (!ProcessShellCommand(cmdInfo))
  82. return FALSE;
  83. */
  84. // The main window has been initialized, so show and update it.
  85. pMainFrame->ShowWindow(m_nCmdShow);
  86. pMainFrame->UpdateWindow();
  87. ScheduleInit () ;
  88. EventInit () ;
  89. return TRUE;
  90. }
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CAboutDlg dialog used for App About
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96. CAboutDlg();
  97. // Dialog Data
  98. //{{AFX_DATA(CAboutDlg)
  99. enum { IDD = IDD_ABOUTBOX };
  100. //}}AFX_DATA
  101. // ClassWizard generated virtual function overrides
  102. //{{AFX_VIRTUAL(CAboutDlg)
  103. protected:
  104. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  105. //}}AFX_VIRTUAL
  106. // Implementation
  107. protected:
  108. //{{AFX_MSG(CAboutDlg)
  109. // No message handlers
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  114. {
  115. //{{AFX_DATA_INIT(CAboutDlg)
  116. //}}AFX_DATA_INIT
  117. }
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120. CDialog::DoDataExchange(pDX);
  121. //{{AFX_DATA_MAP(CAboutDlg)
  122. //}}AFX_DATA_MAP
  123. }
  124. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  125. //{{AFX_MSG_MAP(CAboutDlg)
  126. // No message handlers
  127. //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129. // App command to run the dialog
  130. void CEvtviewApp::OnAppAbout()
  131. {
  132. CAboutDlg aboutDlg;
  133. aboutDlg.DoModal();
  134. }
  135. /////////////////////////////////////////////////////////////////////////////
  136. // CEvtviewApp commands
  137. int CEvtviewApp::ExitInstance()
  138. {
  139. ScheduleDeInit() ;
  140. EventDeInit () ;
  141. return CWinApp::ExitInstance();
  142. }
  143. BOOL CEvtviewApp::OnIdle(LONG lCount)
  144. {
  145. return CWinApp::OnIdle(lCount);
  146. }