//*********************************************************************** // // Paint4.cpp // //*********************************************************************** #include #include "Resource.h" #include "CLine.h" #include "Paint4.h" #include "MainFrame.h" #include "Paint4Doc.h" #include "Paint4View.h" #include "AboutDlg.h" CPaintApp myApp; BEGIN_MESSAGE_MAP (CPaintApp, CWinApp) ON_COMMAND (ID_FILE_NEW, CWinApp::OnFileNew) ON_COMMAND (ID_FILE_OPEN, CWinApp::OnFileOpen) ON_COMMAND (ID_APP_ABOUT, OnAppAbout) END_MESSAGE_MAP () BOOL CPaintApp::InitInstance () { SetRegistryKey ("Programming Windows 95 with MFC"); LoadStdProfileSettings (); CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate ( IDR_MAINFRAME, RUNTIME_CLASS (CPaintDoc), RUNTIME_CLASS (CMainFrame), RUNTIME_CLASS (CPaintView) ); AddDocTemplate (pDocTemplate); RegisterShellFileTypes (TRUE); CCommandLineInfo cmdInfo; ParseCommandLine (cmdInfo); if (!ProcessShellCommand (cmdInfo)) return FALSE; m_pMainWnd->DragAcceptFiles (); return TRUE; } void CPaintApp::OnAppAbout () { CAboutDialog dlg; dlg.DoModal (); }