Dashed.cpp
上传用户:whjcdz88
上传日期:2011-09-07
资源大小:121k
文件大小:3k
源码类别:

图形图象

开发平台:

WINDOWS

  1. // Dashed.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "Dashed.h"
  5. #include "MainFrm.h"
  6. #include "DashedDoc.h"
  7. #include "DashedView.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CDashedApp
  15. BEGIN_MESSAGE_MAP(CDashedApp, CWinApp)
  16. //{{AFX_MSG_MAP(CDashedApp)
  17. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  18. //}}AFX_MSG_MAP
  19. // Standard file based document commands
  20. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  21. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  22. END_MESSAGE_MAP()
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CDashedApp construction
  25. CDashedApp::CDashedApp()
  26. {
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // The one and only CDashedApp object
  30. CDashedApp theApp;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CDashedApp initialization
  33. BOOL CDashedApp::InitInstance()
  34. {
  35. // Standard initialization
  36. // Change the registry key under which our settings are stored.
  37. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  38. LoadStdProfileSettings(0);  // Load standard INI file options (including MRU)
  39. // Register document templates
  40. CSingleDocTemplate* pDocTemplate;
  41. pDocTemplate = new CSingleDocTemplate(
  42. IDR_MAINFRAME,
  43. RUNTIME_CLASS(CDashedDoc),
  44. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  45. RUNTIME_CLASS(CDashedView));
  46. AddDocTemplate(pDocTemplate);
  47. // Parse command line for standard shell commands, DDE, file open
  48. CCommandLineInfo cmdInfo;
  49. ParseCommandLine(cmdInfo);
  50. // Dispatch commands specified on the command line
  51. if (!ProcessShellCommand(cmdInfo))
  52. return FALSE;
  53. m_pMainWnd->ShowWindow(SW_SHOW);
  54. m_pMainWnd->UpdateWindow();
  55. return TRUE;
  56. }
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CAboutDlg dialog used for App About
  59. class CAboutDlg : public CDialog
  60. {
  61. public:
  62. CAboutDlg();
  63. // Dialog Data
  64. //{{AFX_DATA(CAboutDlg)
  65. enum { IDD = IDD_ABOUTBOX };
  66. //}}AFX_DATA
  67. // ClassWizard generated virtual function overrides
  68. //{{AFX_VIRTUAL(CAboutDlg)
  69. protected:
  70. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  71. //}}AFX_VIRTUAL
  72. // Implementation
  73. protected:
  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 CDashedApp::OnAppAbout()
  97. {
  98. CAboutDlg aboutDlg;
  99. aboutDlg.DoModal();
  100. }
  101. /////////////////////////////////////////////////////////////////////////////
  102. // CDashedApp message handlers