2 * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
\r
3 * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
\r
4 * All rights reserved.
\r
6 * Redistribution and use in source and binary forms, with or without
\r
7 * modification, are permitted provided that the following conditions
\r
10 * 1. Redistributions of source code must retain the above copyright
\r
11 * notice, this list of conditions and the following disclaimer.
\r
12 * 2. Redistributions in binary form must reproduce the above copyright
\r
13 * notice, this list of conditions and the following disclaimer in the
\r
14 * documentation and/or other materials provided with the distribution.
\r
15 * 3. Neither the name of the Politecnico di Torino, CACE Technologies
\r
16 * nor the names of its contributors may be used to endorse or promote
\r
17 * products derived from this software without specific prior written
\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
\r
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
\r
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
\r
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
\r
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
\r
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
\r
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
\r
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
35 #include "netmeter.h"
\r
37 #include "MainFrm.h"
\r
38 #include "netmeterDoc.h"
\r
39 #include "netmeterView.h"
\r
42 #define new DEBUG_NEW
\r
44 static char THIS_FILE[] = __FILE__;
\r
47 /////////////////////////////////////////////////////////////////////////////
\r
50 BEGIN_MESSAGE_MAP(CNetmeterApp, CWinApp)
\r
51 //{{AFX_MSG_MAP(CNetmeterApp)
\r
52 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
\r
54 // Standard file based document commands
\r
57 /////////////////////////////////////////////////////////////////////////////
\r
58 // CNetmeterApp construction
\r
60 CNetmeterApp::CNetmeterApp()
\r
64 /////////////////////////////////////////////////////////////////////////////
\r
65 // The one and only CNetmeterApp object
\r
67 CNetmeterApp theApp;
\r
69 /////////////////////////////////////////////////////////////////////////////
\r
70 // CNetmeterApp initialization
\r
72 BOOL CNetmeterApp::InitInstance()
\r
74 // Standard initialization
\r
76 // Change the registry key under which our settings are stored.
\r
77 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
\r
79 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
\r
81 // Register document templates
\r
83 CSingleDocTemplate* pDocTemplate;
\r
84 pDocTemplate = new CSingleDocTemplate(
\r
86 RUNTIME_CLASS(CNetmeterDoc),
\r
87 RUNTIME_CLASS(CMainFrame), // main SDI frame window
\r
88 RUNTIME_CLASS(CNetmeterView));
\r
89 AddDocTemplate(pDocTemplate);
\r
93 // Parse command line for standard shell commands, DDE, file open
\r
94 CCommandLineInfo cmdInfo;
\r
95 ParseCommandLine(cmdInfo);
\r
97 // Dispatch commands specified on the command line
\r
98 if (!ProcessShellCommand(cmdInfo))
\r
100 m_pMainWnd->ShowWindow(SW_SHOW);
\r
101 m_pMainWnd->UpdateWindow();
\r
107 /////////////////////////////////////////////////////////////////////////////
\r
108 // CAboutDlg dialog used for App About
\r
110 class CAboutDlg : public CDialog
\r
116 //{{AFX_DATA(CAboutDlg)
\r
117 enum { IDD = IDD_ABOUTBOX };
\r
120 // ClassWizard generated virtual function overrides
\r
121 //{{AFX_VIRTUAL(CAboutDlg)
\r
123 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
\r
128 //{{AFX_MSG(CAboutDlg)
\r
129 // No message handlers
\r
131 DECLARE_MESSAGE_MAP()
\r
134 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
\r
136 //{{AFX_DATA_INIT(CAboutDlg)
\r
140 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
\r
142 CDialog::DoDataExchange(pDX);
\r
143 //{{AFX_DATA_MAP(CAboutDlg)
\r
147 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
\r
148 //{{AFX_MSG_MAP(CAboutDlg)
\r
149 // No message handlers
\r
153 // App command to run the dialog
\r
154 void CNetmeterApp::OnAppAbout()
\r
156 CAboutDlg aboutDlg;
\r
157 aboutDlg.DoModal();
\r
160 /////////////////////////////////////////////////////////////////////////////
\r
161 // CNetmeterApp message handlers
\r