Leaked source code of windows server 2003
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.

129 lines
3.2 KiB

  1. // mime.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "mime.h"
  5. #include "mainfrm.h"
  6. #include "mimedoc.h"
  7. #include "mimeview.h"
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CMimeApp
  14. BEGIN_MESSAGE_MAP(CMimeApp, CWinApp)
  15. //{{AFX_MSG_MAP(CMimeApp)
  16. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  17. // NOTE - the ClassWizard will add and remove mapping macros here.
  18. // DO NOT EDIT what you see in these blocks of generated code!
  19. //}}AFX_MSG_MAP
  20. // Standard file based document commands
  21. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  22. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  23. END_MESSAGE_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMimeApp construction
  26. CMimeApp::CMimeApp()
  27. {
  28. // TODO: add construction code here,
  29. // Place all significant initialization in InitInstance
  30. }
  31. /////////////////////////////////////////////////////////////////////////////
  32. // The one and only CMimeApp object
  33. CMimeApp theApp;
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMimeApp initialization
  36. BOOL CMimeApp::InitInstance()
  37. {
  38. // Standard initialization
  39. // If you are not using these features and wish to reduce the size
  40. // of your final executable, you should remove from the following
  41. // the specific initialization routines you do not need.
  42. Enable3dControls();
  43. LoadStdProfileSettings(0); // Load standard INI file options (including MRU)
  44. // Register the application's document templates. Document templates
  45. // serve as the connection between documents, frame windows and views.
  46. CSingleDocTemplate* pDocTemplate;
  47. pDocTemplate = new CSingleDocTemplate(
  48. IDR_MAINFRAME,
  49. RUNTIME_CLASS(CMimeDoc),
  50. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  51. RUNTIME_CLASS(CMimeView));
  52. AddDocTemplate(pDocTemplate);
  53. // create a new (empty) document
  54. OnFileNew();
  55. if (m_lpCmdLine[0] != '\0')
  56. {
  57. // TODO: add command line processing here
  58. }
  59. return TRUE;
  60. }
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CAboutDlg dialog used for App About
  63. class CAboutDlg : public CDialog
  64. {
  65. public:
  66. CAboutDlg();
  67. // Dialog Data
  68. //{{AFX_DATA(CAboutDlg)
  69. enum { IDD = IDD_ABOUTBOX };
  70. //}}AFX_DATA
  71. // Implementation
  72. protected:
  73. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  74. //{{AFX_MSG(CAboutDlg)
  75. // No message handlers
  76. //}}AFX_MSG
  77. DECLARE_MESSAGE_MAP()
  78. };
  79. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  80. {
  81. //{{AFX_DATA_INIT(CAboutDlg)
  82. //}}AFX_DATA_INIT
  83. }
  84. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  85. {
  86. CDialog::DoDataExchange(pDX);
  87. //{{AFX_DATA_MAP(CAboutDlg)
  88. //}}AFX_DATA_MAP
  89. }
  90. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  91. //{{AFX_MSG_MAP(CAboutDlg)
  92. // No message handlers
  93. //}}AFX_MSG_MAP
  94. END_MESSAGE_MAP()
  95. // App command to run the dialog
  96. void CMimeApp::OnAppAbout()
  97. {
  98. CAboutDlg aboutDlg;
  99. aboutDlg.DoModal();
  100. }
  101. /////////////////////////////////////////////////////////////////////////////
  102. // CMimeApp commands