1 // HelpEd.cpp : Defines the class behaviors for the application.
9 #include "helpedview.h"
14 static char THIS_FILE[] = __FILE__;
17 /////////////////////////////////////////////////////////////////////////////
20 BEGIN_MESSAGE_MAP(CHelpEdApp, CWinApp)
21 //{{AFX_MSG_MAP(CHelpEdApp)
22 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
23 // NOTE - the ClassWizard will add and remove mapping macros here.
24 // DO NOT EDIT what you see in these blocks of generated code!
26 // Standard file based document commands
27 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
28 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
31 /////////////////////////////////////////////////////////////////////////////
32 // CHelpEdApp construction
34 CHelpEdApp::CHelpEdApp()
36 // TODO: add construction code here,
37 // Place all significant initialization in InitInstance
40 /////////////////////////////////////////////////////////////////////////////
41 // The one and only CHelpEdApp object
45 /////////////////////////////////////////////////////////////////////////////
46 // CHelpEdApp initialization
48 BOOL CHelpEdApp::InitInstance()
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.
56 Enable3dControls(); // Call this when using MFC in a shared DLL
58 Enable3dControlsStatic(); // Call this when linking to MFC statically
61 // Change the registry key under which our settings are stored.
62 // TODO: You should modify this string to be something appropriate
63 // such as the name of your company or organization.
64 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
66 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
68 // Register the application's document templates. Document templates
69 // serve as the connection between documents, frame windows and views.
71 CSingleDocTemplate* pDocTemplate;
72 pDocTemplate = new CSingleDocTemplate(
74 RUNTIME_CLASS(CHelpEdDoc),
75 RUNTIME_CLASS(CMainFrame), // main SDI frame window
76 RUNTIME_CLASS(CHelpEdView));
77 AddDocTemplate(pDocTemplate);
79 // Enable DDE Execute open
81 RegisterShellFileTypes(TRUE);
83 // Parse command line for standard shell commands, DDE, file open
84 CCommandLineInfo cmdInfo;
85 ParseCommandLine(cmdInfo);
87 // Dispatch commands specified on the command line
88 if (!ProcessShellCommand(cmdInfo))
91 // The one and only window has been initialized, so show and update it.
92 m_pMainWnd->ShowWindow(SW_SHOW);
93 m_pMainWnd->UpdateWindow();
95 // Enable drag/drop open
96 m_pMainWnd->DragAcceptFiles();
102 /////////////////////////////////////////////////////////////////////////////
103 // CAboutDlg dialog used for App About
105 class CAboutDlg : public CDialog
111 //{{AFX_DATA(CAboutDlg)
112 enum { IDD = IDD_ABOUTBOX };
115 // ClassWizard generated virtual function overrides
116 //{{AFX_VIRTUAL(CAboutDlg)
118 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
123 //{{AFX_MSG(CAboutDlg)
124 // No message handlers
126 DECLARE_MESSAGE_MAP()
129 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
131 //{{AFX_DATA_INIT(CAboutDlg)
135 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
137 CDialog::DoDataExchange(pDX);
138 //{{AFX_DATA_MAP(CAboutDlg)
142 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
143 //{{AFX_MSG_MAP(CAboutDlg)
144 // No message handlers
148 // App command to run the dialog
149 void CHelpEdApp::OnAppAbout()
155 /////////////////////////////////////////////////////////////////////////////
156 // CHelpEdApp message handlers