【正文】
AND(ID_FILE_NEW, CWinApp::OnFileNew) ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) // Standard print setup mand ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMyApp construction CMyApp::CMyApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// 14 // The one and only CMyApp object CMyApp theApp。 // Call this when linking to MFC statically endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your pany or anization. SetRegistryKey(_T(Local AppWizardGenerated Applications))。 pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMyDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CMyView))。 // Dispatch mands specified on the mand line if (!ProcessShellCommand(cmdInfo)) return FALSE。 } ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg()。 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { 16 //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX)。 DECLARE_DYNCREATE(CMainFrame) // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainFrame) virtual BOOL PreCreateWindow(CREATESTRUCTamp。 virtual void Dump(CDumpContextamp。 // Generated message map functions protected: //{{AFX_MSG(CMainFrame) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)。 before including this file for PCH endif include // main symbols ///////////////////////////////////////////////////////////////////////////// // CMyApp: // See 簡單文本 .cpp for the implementation of this class // class CMyApp : public CWinApp { public: CMyApp()。 ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. endif // !defined(AFX__H__1DD5B072_4F80_4F7C_9F05_2FFBCD7DE7F3__INCLUDED_) // 簡單文本 : interface of the CMyDoc class // ///////////////////////////////////////////////////////////////////////////// if !defined(AFX_DOC_H__55667EB4_AB9C_44C9_B790_E5E249118EB1__INCLUDED_) define AFX_DOC_H__55667EB4_AB9C_44C9_B790_E5E249118EB1__INCLUDED_ if _MSC_VER 1000 pragma once endif // _MSC_VER 1000 class CMyDoc : public CDocument { protected: // create from serialization only CMyDoc()。 //}}AFX_VIRTUAL // Implementation public: virtual ~CMyDoc()。 endif protected: // Generated message map functions protected: //{{AFX_MSG(CMyDoc) // NOTE the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }。 // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCTamp。 virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)。 dc) con