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.

164 lines
4.4 KiB

  1. // simpsons.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "simpsons.h"
  5. #include "MainFrm.h"
  6. #include "SimpDoc.h"
  7. #include "SimpView.h"
  8. #include <DXTrans.h>
  9. #include <dxtguid.c>
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. #include "../gpinit.inc"
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CSimponsApp
  18. BEGIN_MESSAGE_MAP(CSimponsApp, CWinApp)
  19. //{{AFX_MSG_MAP(CSimponsApp)
  20. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  21. // NOTE - the ClassWizard will add and remove mapping macros here.
  22. // DO NOT EDIT what you see in these blocks of generated code!
  23. //}}AFX_MSG_MAP
  24. // Standard file based document commands
  25. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  26. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  27. END_MESSAGE_MAP()
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CSimponsApp construction
  30. CSimponsApp::CSimponsApp()
  31. {
  32. // TODO: add construction code here,
  33. // Place all significant initialization in InitInstance
  34. }
  35. CSimponsApp::~CSimponsApp()
  36. {
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // The one and only CSimponsApp object
  40. CSimponsApp theApp;
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CSimponsApp initialization
  43. BOOL CSimponsApp::InitInstance()
  44. {
  45. if (!gGdiplusInitHelper.IsValid())
  46. {
  47. return FALSE;
  48. }
  49. AfxEnableControlContainer();
  50. // Standard initialization
  51. // If you are not using these features and wish to reduce the size
  52. // of your final executable, you should remove from the following
  53. // the specific initialization routines you do not need.
  54. #ifdef _AFXDLL
  55. Enable3dControls(); // Call this when using MFC in a shared DLL
  56. #else
  57. Enable3dControlsStatic(); // Call this when linking to MFC statically
  58. #endif
  59. // Change the registry key under which our settings are stored.
  60. // You should modify this string to be something appropriate
  61. // such as the name of your company or organization.
  62. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  63. LoadStdProfileSettings(); // Load standard INI file options (including MRU)
  64. // Register the application's document templates. Document templates
  65. // serve as the connection between documents, frame windows and views.
  66. CSingleDocTemplate* pDocTemplate;
  67. pDocTemplate = new CSingleDocTemplate(
  68. IDR_MAINFRAME,
  69. RUNTIME_CLASS(CSimpsonsDoc),
  70. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  71. RUNTIME_CLASS(CSimpsonsView));
  72. AddDocTemplate(pDocTemplate);
  73. // Parse command line for standard shell commands, DDE, file open
  74. CCommandLineInfo cmdInfo;
  75. ParseCommandLine(cmdInfo);
  76. // Dispatch commands specified on the command line
  77. if (!ProcessShellCommand(cmdInfo))
  78. return FALSE;
  79. // The one and only window has been initialized, so show and update it.
  80. m_pMainWnd->ShowWindow(SW_SHOW);
  81. m_pMainWnd->UpdateWindow();
  82. return TRUE;
  83. }
  84. /////////////////////////////////////////////////////////////////////////////
  85. // CAboutDlg dialog used for App About
  86. class CAboutDlg : public CDialog
  87. {
  88. public:
  89. CAboutDlg();
  90. // Dialog Data
  91. //{{AFX_DATA(CAboutDlg)
  92. enum { IDD = IDD_ABOUTBOX };
  93. //}}AFX_DATA
  94. // ClassWizard generated virtual function overrides
  95. //{{AFX_VIRTUAL(CAboutDlg)
  96. protected:
  97. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  98. //}}AFX_VIRTUAL
  99. // Implementation
  100. protected:
  101. //{{AFX_MSG(CAboutDlg)
  102. // No message handlers
  103. //}}AFX_MSG
  104. DECLARE_MESSAGE_MAP()
  105. };
  106. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  107. {
  108. //{{AFX_DATA_INIT(CAboutDlg)
  109. //}}AFX_DATA_INIT
  110. }
  111. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  112. {
  113. CDialog::DoDataExchange(pDX);
  114. //{{AFX_DATA_MAP(CAboutDlg)
  115. //}}AFX_DATA_MAP
  116. }
  117. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  118. //{{AFX_MSG_MAP(CAboutDlg)
  119. // No message handlers
  120. //}}AFX_MSG_MAP
  121. END_MESSAGE_MAP()
  122. // App command to run the dialog
  123. void CSimponsApp::OnAppAbout()
  124. {
  125. CAboutDlg aboutDlg;
  126. aboutDlg.DoModal();
  127. }
  128. /////////////////////////////////////////////////////////////////////////////
  129. // CSimponsApp commands