2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 // HelpEd.cpp : Defines the class behaviors for the application.
16 #include "helpeddoc.h"
17 #include "helpedview.h"
22 static char THIS_FILE[] = __FILE__;
25 /////////////////////////////////////////////////////////////////////////////
28 BEGIN_MESSAGE_MAP(CHelpEdApp, CWinApp)
29 //{{AFX_MSG_MAP(CHelpEdApp)
30 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
31 // NOTE - the ClassWizard will add and remove mapping macros here.
32 // DO NOT EDIT what you see in these blocks of generated code!
34 // Standard file based document commands
35 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
36 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
39 /////////////////////////////////////////////////////////////////////////////
40 // CHelpEdApp construction
42 CHelpEdApp::CHelpEdApp()
44 // TODO: add construction code here,
45 // Place all significant initialization in InitInstance
48 /////////////////////////////////////////////////////////////////////////////
49 // The one and only CHelpEdApp object
53 /////////////////////////////////////////////////////////////////////////////
54 // CHelpEdApp initialization
56 BOOL CHelpEdApp::InitInstance()
58 // Standard initialization
59 // If you are not using these features and wish to reduce the size
60 // of your final executable, you should remove from the following
61 // the specific initialization routines you do not need.
64 Enable3dControls(); // Call this when using MFC in a shared DLL
66 Enable3dControlsStatic(); // Call this when linking to MFC statically
69 // Change the registry key under which our settings are stored.
70 // TODO: You should modify this string to be something appropriate
71 // such as the name of your company or organization.
72 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
74 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
76 // Register the application's document templates. Document templates
77 // serve as the connection between documents, frame windows and views.
79 CSingleDocTemplate* pDocTemplate;
80 pDocTemplate = new CSingleDocTemplate(
82 RUNTIME_CLASS(CHelpEdDoc),
83 RUNTIME_CLASS(CMainFrame), // main SDI frame window
84 RUNTIME_CLASS(CHelpEdView));
85 AddDocTemplate(pDocTemplate);
87 // Enable DDE Execute open
89 RegisterShellFileTypes(TRUE);
91 // Parse command line for standard shell commands, DDE, file open
92 CCommandLineInfo cmdInfo;
93 ParseCommandLine(cmdInfo);
95 // Dispatch commands specified on the command line
96 if (!ProcessShellCommand(cmdInfo))
99 // The one and only window has been initialized, so show and update it.
100 m_pMainWnd->ShowWindow(SW_SHOW);
101 m_pMainWnd->UpdateWindow();
103 // Enable drag/drop open
104 m_pMainWnd->DragAcceptFiles();
110 /////////////////////////////////////////////////////////////////////////////
111 // CAboutDlg dialog used for App About
113 class CAboutDlg : public CDialog
119 //{{AFX_DATA(CAboutDlg)
120 enum { IDD = IDD_ABOUTBOX };
123 // ClassWizard generated virtual function overrides
124 //{{AFX_VIRTUAL(CAboutDlg)
126 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
131 //{{AFX_MSG(CAboutDlg)
132 // No message handlers
134 DECLARE_MESSAGE_MAP()
137 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
139 //{{AFX_DATA_INIT(CAboutDlg)
143 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
145 CDialog::DoDataExchange(pDX);
146 //{{AFX_DATA_MAP(CAboutDlg)
150 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
151 //{{AFX_MSG_MAP(CAboutDlg)
152 // No message handlers
156 // App command to run the dialog
157 void CHelpEdApp::OnAppAbout()
163 /////////////////////////////////////////////////////////////////////////////
164 // CHelpEdApp message handlers