Leaked source code of windows server 2003
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.

177 lines
4.7 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*++
  3. Module Name:
  4. LicMgr.cpp
  5. Abstract:
  6. This Module contains the implementation of CLicMgrApp class.
  7. (The Application class)
  8. Author:
  9. Arathi Kundapur (v-akunda) 22-Feb-1998
  10. Revision History:
  11. --*/
  12. #include "stdafx.h"
  13. #include "LicMgr.h"
  14. #include "defines.h"
  15. #include "LSServer.h"
  16. #include "MainFrm.h"
  17. #include "LSMgrDoc.h"
  18. #include "LtView.h"
  19. #include "cmdln.h"
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CLicMgrApp
  27. BEGIN_MESSAGE_MAP(CLicMgrApp, CWinApp)
  28. //{{AFX_MSG_MAP(CLicMgrApp)
  29. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  30. // NOTE - the ClassWizard will add and remove mapping macros here.
  31. // DO NOT EDIT what you see in these blocks of generated code!
  32. //}}AFX_MSG_MAP
  33. // Standard file based document commands
  34. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  35. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  36. // Standard print setup command
  37. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  38. END_MESSAGE_MAP()
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CLicMgrApp construction
  41. CLicMgrApp::CLicMgrApp()
  42. {
  43. // TODO: add construction code here,
  44. // Place all significant initialization in InitInstance
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // The one and only CLicMgrApp object
  48. CLicMgrApp theApp;
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CLicMgrApp initialization
  51. BOOL CLicMgrApp::InitInstance()
  52. {
  53. AfxEnableControlContainer();
  54. // Standard initialization
  55. // If you are not using these features and wish to reduce the size
  56. // of your final executable, you should remove from the following
  57. // the specific initialization routines you do not need.
  58. #ifdef _AFXDLL
  59. Enable3dControls(); // Call this when using MFC in a shared DLL
  60. #else
  61. Enable3dControlsStatic(); // Call this when linking to MFC statically
  62. #endif
  63. // Change the registry key under which our settings are stored.
  64. // You should modify this string to be something appropriate
  65. // such as the name of your company or organization.
  66. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  67. 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.
  70. CSingleDocTemplate* pDocTemplate;
  71. pDocTemplate = new CSingleDocTemplate(
  72. IDR_MAINFRAME,
  73. RUNTIME_CLASS(CLicMgrDoc),
  74. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  75. RUNTIME_CLASS(CLicMgrLeftView));
  76. AddDocTemplate(pDocTemplate);
  77. // Parse command line for standard shell commands, DDE, file open
  78. CLicMgrCommandLine cmdInfo;
  79. ParseCommandLine(cmdInfo);
  80. m_Server = cmdInfo.m_FileName;
  81. // cmdInfo.m_strFileName = _T("");
  82. // Dispatch commands specified on the command line
  83. if (!ProcessShellCommand(cmdInfo))
  84. return FALSE;
  85. // The one and only window has been initialized, so show and update it.
  86. m_pMainWnd->ShowWindow(SW_SHOW);
  87. m_pMainWnd->UpdateWindow();
  88. m_pMainWnd->PostMessage(WM_ENUMERATESERVER);
  89. return TRUE;
  90. }
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CAboutDlg dialog used for App About
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96. CAboutDlg();
  97. // Dialog Data
  98. //{{AFX_DATA(CAboutDlg)
  99. enum { IDD = IDD_ABOUTBOX };
  100. //}}AFX_DATA
  101. // ClassWizard generated virtual function overrides
  102. //{{AFX_VIRTUAL(CAboutDlg)
  103. protected:
  104. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  105. //}}AFX_VIRTUAL
  106. // Implementation
  107. protected:
  108. //{{AFX_MSG(CAboutDlg)
  109. // No message handlers
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  114. {
  115. //{{AFX_DATA_INIT(CAboutDlg)
  116. //}}AFX_DATA_INIT
  117. }
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120. CDialog::DoDataExchange(pDX);
  121. //{{AFX_DATA_MAP(CAboutDlg)
  122. //}}AFX_DATA_MAP
  123. }
  124. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  125. //{{AFX_MSG_MAP(CAboutDlg)
  126. // No message handlers
  127. //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129. // App command to run the dialog
  130. void CLicMgrApp::OnAppAbout()
  131. {
  132. CAboutDlg aboutDlg;
  133. aboutDlg.DoModal();
  134. }
  135. /////////////////////////////////////////////////////////////////////////////
  136. // CLicMgrApp commands