Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
5.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: SetupLGS.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of SetupLGS.cpp
  13. //----------------------------------------------------------------------------
  14. // SetupLGS.cpp : Defines the class behaviors for the application.
  15. //
  16. #include "stdafx.h"
  17. #include "SetupLGS.h"
  18. #include "MainFrm.h"
  19. #include "ChildFrm.h"
  20. #include "SetupLGSDoc.h"
  21. #include "SetupLGSView.h"
  22. #ifdef _DEBUG
  23. #define new DEBUG_NEW
  24. #undef THIS_FILE
  25. static char THIS_FILE[] = __FILE__;
  26. #endif
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CSetupLGSApp
  29. BEGIN_MESSAGE_MAP(CSetupLGSApp, CWinApp)
  30. //{{AFX_MSG_MAP(CSetupLGSApp)
  31. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  32. // NOTE - the ClassWizard will add and remove mapping macros here.
  33. // DO NOT EDIT what you see in these blocks of generated code!
  34. //}}AFX_MSG_MAP
  35. // Standard file based document commands
  36. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  37. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  38. // Standard print setup command
  39. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CSetupLGSApp construction
  43. CSetupLGSApp::CSetupLGSApp()
  44. {
  45. // TODO: add construction code here,
  46. // Place all significant initialization in InitInstance
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. // The one and only CSetupLGSApp object
  50. CSetupLGSApp theApp;
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CSetupLGSApp initialization
  53. BOOL CSetupLGSApp::InitInstance()
  54. {
  55. if( !m_InstanceLock.Lock( "LASER_GUARD_SETUP_LGS_ISSC_INSTANCE_LOCK_MUTEX" ) )
  56. {
  57. ::MessageBox( NULL, "Another copy of program already started!", NULL, MB_OK | MB_ICONEXCLAMATION );
  58. return FALSE;
  59. }
  60. AfxEnableControlContainer();
  61. // Standard initialization
  62. // If you are not using these features and wish to reduce the size
  63. // of your final executable, you should remove from the following
  64. // the specific initialization routines you do not need.
  65. #ifdef _AFXDLL
  66. Enable3dControls(); // Call this when using MFC in a shared DLL
  67. #else
  68. Enable3dControlsStatic(); // Call this when linking to MFC statically
  69. #endif
  70. // Change the registry key under which our settings are stored.
  71. // TODO: You should modify this string to be something appropriate
  72. // such as the name of your company or organization.
  73. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  74. LoadStdProfileSettings(); // Load standard INI file options (including MRU)
  75. // Register the application's document templates. Document templates
  76. // serve as the connection between documents, frame windows and views.
  77. CMultiDocTemplate* pDocTemplate;
  78. pDocTemplate = new CMultiDocTemplate(
  79. IDR_SETUPLTYPE,
  80. RUNTIME_CLASS(CSetupLGSDoc),
  81. RUNTIME_CLASS(CChildFrame), // custom MDI child frame
  82. RUNTIME_CLASS(CSetupLGSView));
  83. AddDocTemplate(pDocTemplate);
  84. // create main MDI Frame window
  85. CMainFrame* pMainFrame = new CMainFrame;
  86. if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  87. return FALSE;
  88. m_pMainWnd = pMainFrame;
  89. // Parse command line for standard shell commands, DDE, file open
  90. CCommandLineInfo cmdInfo;
  91. ParseCommandLine(cmdInfo);
  92. if( cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew )
  93. cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
  94. // Dispatch commands specified on the command line
  95. if (!ProcessShellCommand(cmdInfo))
  96. return FALSE;
  97. // The main window has been initialized, so show and update it.
  98. pMainFrame->ShowWindow(m_nCmdShow);
  99. pMainFrame->UpdateWindow();
  100. return TRUE;
  101. }
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CAboutDlg dialog used for App About
  104. class CAboutDlg : public CDialog
  105. {
  106. public:
  107. CAboutDlg();
  108. // Dialog Data
  109. //{{AFX_DATA(CAboutDlg)
  110. enum { IDD = IDD_ABOUTBOX };
  111. //}}AFX_DATA
  112. // ClassWizard generated virtual function overrides
  113. //{{AFX_VIRTUAL(CAboutDlg)
  114. protected:
  115. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  116. //}}AFX_VIRTUAL
  117. // Implementation
  118. protected:
  119. //{{AFX_MSG(CAboutDlg)
  120. // No message handlers
  121. //}}AFX_MSG
  122. DECLARE_MESSAGE_MAP()
  123. };
  124. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  125. {
  126. //{{AFX_DATA_INIT(CAboutDlg)
  127. //}}AFX_DATA_INIT
  128. }
  129. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  130. {
  131. CDialog::DoDataExchange(pDX);
  132. //{{AFX_DATA_MAP(CAboutDlg)
  133. //}}AFX_DATA_MAP
  134. }
  135. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  136. //{{AFX_MSG_MAP(CAboutDlg)
  137. // No message handlers
  138. //}}AFX_MSG_MAP
  139. END_MESSAGE_MAP()
  140. // App command to run the dialog
  141. void CSetupLGSApp::OnAppAbout()
  142. {
  143. CAboutDlg aboutDlg;
  144. aboutDlg.DoModal();
  145. }
  146. /////////////////////////////////////////////////////////////////////////////
  147. // CSetupLGSApp message handlers
  148. int CSetupLGSApp::ExitInstance()
  149. {
  150. m_InstanceLock.Unlock();
  151. return CWinApp::ExitInstance();
  152. }