CreditsTest.cpp
上传用户:zhenlu1001
上传日期:2007-01-02
资源大小:131k
文件大小:3k
源码类别:

Static控件

开发平台:

Visual C++

  1. // CreditsTest.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "CreditsTest.h"
  5. #include "MainFrm.h"
  6. #include "CreditsTestDoc.h"
  7. #include "CreditsTestView.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CCreditsTestApp
  15. BEGIN_MESSAGE_MAP(CCreditsTestApp, CWinApp)
  16. //{{AFX_MSG_MAP(CCreditsTestApp)
  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. // Standard print setup command
  23. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  24. END_MESSAGE_MAP()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCreditsTestApp construction
  27. CCreditsTestApp::CCreditsTestApp()
  28. {
  29. }
  30. /////////////////////////////////////////////////////////////////////////////
  31. // The one and only CCreditsTestApp object
  32. CCreditsTestApp theApp;
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CCreditsTestApp initialization
  35. BOOL CCreditsTestApp::InitInstance()
  36. {
  37. // Standard initialization
  38. #ifdef _AFXDLL
  39. Enable3dControls(); // Call this when using MFC in a shared DLL
  40. #else
  41. Enable3dControlsStatic(); // Call this when linking to MFC statically
  42. #endif
  43. // Change the registry key under which our settings are stored.
  44. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  45. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  46. // Register document templates
  47. CSingleDocTemplate* pDocTemplate;
  48. pDocTemplate = new CSingleDocTemplate(
  49. IDR_MAINFRAME,
  50. RUNTIME_CLASS(CCreditsTestDoc),
  51. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  52. RUNTIME_CLASS(CCreditsTestView));
  53. AddDocTemplate(pDocTemplate);
  54. // Parse command line for standard shell commands, DDE, file open
  55. CCommandLineInfo cmdInfo;
  56. ParseCommandLine(cmdInfo);
  57. // Dispatch commands specified on the command line
  58. if (!ProcessShellCommand(cmdInfo))
  59. return FALSE;
  60. m_pMainWnd->ShowWindow(SW_SHOW);
  61. m_pMainWnd->UpdateWindow();
  62. return TRUE;
  63. }
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CAboutDlg dialog used for App About
  66. class CAboutDlg : public CDialog
  67. {
  68. public:
  69. CAboutDlg();
  70. // Dialog Data
  71. //{{AFX_DATA(CAboutDlg)
  72. enum { IDD = IDD_ABOUTBOX };
  73. //}}AFX_DATA
  74. // ClassWizard generated virtual function overrides
  75. //{{AFX_VIRTUAL(CAboutDlg)
  76. protected:
  77. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  78. //}}AFX_VIRTUAL
  79. // Implementation
  80. protected:
  81. //{{AFX_MSG(CAboutDlg)
  82. // No message handlers
  83. //}}AFX_MSG
  84. DECLARE_MESSAGE_MAP()
  85. };
  86. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  87. {
  88. //{{AFX_DATA_INIT(CAboutDlg)
  89. //}}AFX_DATA_INIT
  90. }
  91. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  92. {
  93. CDialog::DoDataExchange(pDX);
  94. //{{AFX_DATA_MAP(CAboutDlg)
  95. //}}AFX_DATA_MAP
  96. }
  97. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  98. //{{AFX_MSG_MAP(CAboutDlg)
  99. // No message handlers
  100. //}}AFX_MSG_MAP
  101. END_MESSAGE_MAP()
  102. // App command to run the dialog
  103. void CCreditsTestApp::OnAppAbout()
  104. {
  105. CAboutDlg aboutDlg;
  106. aboutDlg.DoModal();
  107. }
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CCreditsTestApp commands