Header
Product Comparison: USB I2C | USB SPI | USB GPIO
  • My Account
  • Shopping Cart
  • Products
  • My Account
  • About
  • Products
  • PC-I2C/SPI/GPIO Adapters
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

D:/_sources/u2c_12/ControlPanel/ControlPanel.cpp

Go to the documentation of this file.
00001 // Copyright (C)2006 Diolan ( http://www.diolan.com )
00002 //
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation
00006 //
00007 // This program is distributed in the hope that it will be useful,
00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 // GNU General Public License for more details.
00011 
00012 #include "stdafx.h"
00013 #include "ControlPanel.h"
00014 
00015 #include "MainFrm.h"
00016 #include "ControlPanelDoc.h"
00017 #include "ControlPanelView.h"
00018 #include "../Common/StaticUrl.h"
00019 
00020 #ifdef _DEBUG
00021 #define new DEBUG_NEW
00022 #undef THIS_FILE
00023 static char THIS_FILE[] = __FILE__;
00024 #endif
00025 
00027 // CControlPanelApp
00028 
00029 BEGIN_MESSAGE_MAP(CControlPanelApp, CWinApp)
00030         //{{AFX_MSG_MAP(CControlPanelApp)
00031         ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00032                 // NOTE - the ClassWizard will add and remove mapping macros here.
00033                 //    DO NOT EDIT what you see in these blocks of generated code!
00034         //}}AFX_MSG_MAP
00035         // Standard file based document commands
00036         ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00037         ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00038         // Standard print setup command
00039         ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00040 END_MESSAGE_MAP()
00041 
00043 // CControlPanelApp construction
00044 
00045 CControlPanelApp::CControlPanelApp()
00046 {
00047         // TODO: add construction code here,
00048         // Place all significant initialization in InitInstance
00049 }
00050 
00052 // The one and only CControlPanelApp object
00053 
00054 CControlPanelApp theApp;
00055 
00057 // CControlPanelApp initialization
00058 
00059 BOOL CControlPanelApp::InitInstance()
00060 {
00061         // Initialize OLE libraries
00062         if (!AfxOleInit())
00063         {
00064                 AfxMessageBox(IDP_OLE_INIT_FAILED);
00065                 return FALSE;
00066         }
00067 
00068 
00069         SetRegistryKey(_T("Diolan\\U2C-12"));
00070 
00071         LoadStdProfileSettings();  // Load standard INI file options (including MRU)
00072 
00073         // Register the application's document templates.  Document templates
00074         //  serve as the connection between documents, frame windows and views.
00075 
00076         CSingleDocTemplate* pDocTemplate;
00077         pDocTemplate = new CSingleDocTemplate(
00078                 IDR_MAINFRAME,
00079                 RUNTIME_CLASS(CControlPanelDoc),
00080                 RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00081                 RUNTIME_CLASS(CControlPanelView));
00082         pDocTemplate->SetContainerInfo(IDR_CNTR_INPLACE);
00083         AddDocTemplate(pDocTemplate);
00084 
00085 
00086 /*
00087         CSingleDocTemplate* pDocTemplate;
00088         pDocTemplate = new CSingleDocTemplate(
00089                 IDR_MAINFRAME,
00090                 RUNTIME_CLASS(CControlPanelDoc),
00091                 RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00092                 RUNTIME_CLASS(CControlPanelView));
00093         pDocTemplate->SetContainerInfo(IDR_CNTR_INPLACE);
00094         AddDocTemplate(pDocTemplate);
00095 */
00096 
00097         // Parse command line for standard shell commands, DDE, file open
00098         CCommandLineInfo cmdInfo;
00099         ParseCommandLine(cmdInfo);
00100 
00101         // Dispatch commands specified on the command line
00102         if (!ProcessShellCommand(cmdInfo))
00103                 return FALSE;
00104 
00105         // The one and only window has been initialized, so show and update it.
00106         m_pMainWnd->ShowWindow(SW_SHOW);
00107         m_pMainWnd->UpdateWindow();
00108 
00109         return TRUE;
00110 }
00111 
00112 
00114 // CAboutDlg dialog used for App About
00115 
00116 class CAboutDlg : public CDialog
00117 {
00118 public:
00119         CAboutDlg();
00120 
00121 // Dialog Data
00122         //{{AFX_DATA(CAboutDlg)
00123         enum { IDD = IDD_ABOUTBOX };
00124         //}}AFX_DATA
00125 
00126         // ClassWizard generated virtual function overrides
00127         //{{AFX_VIRTUAL(CAboutDlg)
00128         protected:
00129         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00130         //}}AFX_VIRTUAL
00131 
00132 // Implementation
00133 protected:
00134         //{{AFX_MSG(CAboutDlg)
00135                 // No message handlers
00136         //}}AFX_MSG
00137         DECLARE_MESSAGE_MAP()
00138 public:
00139         CStaticUrl m_Link;
00140         virtual BOOL OnInitDialog();
00141 };
00142 
00143 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00144 {
00145         //{{AFX_DATA_INIT(CAboutDlg)
00146         //}}AFX_DATA_INIT
00147 
00148 
00149 }
00150 
00151 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00152 {
00153         CDialog::DoDataExchange(pDX);
00154         //{{AFX_DATA_MAP(CAboutDlg)
00155         //}}AFX_DATA_MAP
00156         DDX_Control(pDX, IDC_A_LINK, m_Link);
00157 }
00158 
00159 BOOL CAboutDlg::OnInitDialog()
00160 {
00161         CDialog::OnInitDialog();
00162         return TRUE;  // return TRUE unless you set the focus to a control
00163 }
00164 
00165 
00166 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00167         //{{AFX_MSG_MAP(CAboutDlg)
00168                 // No message handlers
00169         //}}AFX_MSG_MAP
00170 END_MESSAGE_MAP()
00171 
00172 // App command to run the dialog
00173 void CControlPanelApp::OnAppAbout()
00174 {
00175         CAboutDlg aboutDlg;
00176         aboutDlg.DoModal();
00177 }
00178 
00180 // CControlPanelApp message handlers
00181 
00182 
  • Products
  • PC-I2C/SPI/GPIO Adapters
  • Comparison
  • PC-I2C/SPI/GPIO Adapter DLN-1
  • USB-I2C/SPI/GPIO Adapter DLN-2
  • Multiprotocol Master DLN-4M
  • Multiprotocol Slave DLN-4S
  • Downloads
  • Software
  • Documentation
  • SW Tools & Examples
  • Development Boards
  • Open Source Projects
  • Discontinued Products
  • API Documentation
  • Downloads
  • SW Tools and Examples
footer top footer bottom
© Copyright Diolan 2006-2012