MixViewer.cpp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // MixViewer.cpp : Defines the class behaviors for the application.
  19. //
  20. #include "stdafx.h"
  21. #include "MixViewer.h"
  22. #include "MainFrm.h"
  23. #include "MixViewerDoc.h"
  24. #include "MixViewerView.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CMixViewerApp
  32. BEGIN_MESSAGE_MAP(CMixViewerApp, CWinApp)
  33. //{{AFX_MSG_MAP(CMixViewerApp)
  34. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  35. // NOTE - the ClassWizard will add and remove mapping macros here.
  36. // DO NOT EDIT what you see in these blocks of generated code!
  37. //}}AFX_MSG_MAP
  38. // Standard file based document commands
  39. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  40. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  41. END_MESSAGE_MAP()
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CMixViewerApp construction
  44. CMixViewerApp::CMixViewerApp()
  45. {
  46. // TODO: add construction code here,
  47. // Place all significant initialization in InitInstance
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // The one and only CMixViewerApp object
  51. CMixViewerApp theApp;
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CMixViewerApp initialization
  54. BOOL CMixViewerApp::InitInstance()
  55. {
  56. AfxEnableControlContainer();
  57. // Standard initialization
  58. // If you are not using these features and wish to reduce the size
  59. // of your final executable, you should remove from the following
  60. // the specific initialization routines you do not need.
  61. #ifdef _AFXDLL
  62. Enable3dControls(); // Call this when using MFC in a shared DLL
  63. #else
  64. Enable3dControlsStatic(); // Call this when linking to MFC statically
  65. #endif
  66. // Change the registry key under which our settings are stored.
  67. // TODO: You should modify this string to be something appropriate
  68. // such as the name of your company or organization.
  69. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  70. LoadStdProfileSettings(8); // Load standard INI file options (including MRU)
  71. // Register the application's document templates. Document templates
  72. // serve as the connection between documents, frame windows and views.
  73. CSingleDocTemplate* pDocTemplate;
  74. pDocTemplate = new CSingleDocTemplate(
  75. IDR_MAINFRAME,
  76. RUNTIME_CLASS(CMixViewerDoc),
  77. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  78. RUNTIME_CLASS(CMixViewerView));
  79. AddDocTemplate(pDocTemplate);
  80. // Enable DDE Execute open
  81. EnableShellOpen();
  82. RegisterShellFileTypes(TRUE);
  83. // Parse command line for standard shell commands, DDE, file open
  84. CCommandLineInfo cmdInfo;
  85. ParseCommandLine(cmdInfo);
  86. // Dispatch commands specified on the command line
  87. if (!ProcessShellCommand(cmdInfo))
  88. return FALSE;
  89. // The one and only window has been initialized, so show and update it.
  90. m_pMainWnd->DragAcceptFiles (TRUE);
  91. m_pMainWnd->ShowWindow (SW_SHOW);
  92. m_pMainWnd->UpdateWindow ();
  93. return TRUE;
  94. }
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CAboutDlg dialog used for App About
  97. class CAboutDlg : public CDialog
  98. {
  99. public:
  100. CAboutDlg();
  101. // Dialog Data
  102. //{{AFX_DATA(CAboutDlg)
  103. enum { IDD = IDD_ABOUTBOX };
  104. //}}AFX_DATA
  105. // ClassWizard generated virtual function overrides
  106. //{{AFX_VIRTUAL(CAboutDlg)
  107. protected:
  108. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  109. //}}AFX_VIRTUAL
  110. // Implementation
  111. protected:
  112. //{{AFX_MSG(CAboutDlg)
  113. // No message handlers
  114. //}}AFX_MSG
  115. DECLARE_MESSAGE_MAP()
  116. };
  117. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  118. {
  119. //{{AFX_DATA_INIT(CAboutDlg)
  120. //}}AFX_DATA_INIT
  121. }
  122. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  123. {
  124. CDialog::DoDataExchange(pDX);
  125. //{{AFX_DATA_MAP(CAboutDlg)
  126. //}}AFX_DATA_MAP
  127. }
  128. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  129. //{{AFX_MSG_MAP(CAboutDlg)
  130. // No message handlers
  131. //}}AFX_MSG_MAP
  132. END_MESSAGE_MAP()
  133. // App command to run the dialog
  134. void CMixViewerApp::OnAppAbout()
  135. {
  136. CAboutDlg aboutDlg;
  137. aboutDlg.DoModal();
  138. }
  139. /////////////////////////////////////////////////////////////////////////////
  140. // CMixViewerApp message handlers