treeview.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. // treeview.cpp : Defines the class behaviors for the application.
  14. //
  15. #include "stdafx.h"
  16. #include "treeview.h"
  17. #include "treeviewDlg.h"
  18. #include "inspectctrl.hpp"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CTreeviewApp
  26. BEGIN_MESSAGE_MAP(CTreeviewApp, CWinApp)
  27. //{{AFX_MSG_MAP(CTreeviewApp)
  28. // NOTE - the ClassWizard will add and remove mapping macros here.
  29. // DO NOT EDIT what you see in these blocks of generated code!
  30. //}}AFX_MSG
  31. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  32. END_MESSAGE_MAP()
  33. void CCmdLineInfo::ParseParam(LPCTSTR param, BOOL flag, BOOL last)
  34. {
  35. if(flag)
  36. {
  37. }
  38. else
  39. {
  40. app.inFilename = strdup(param);
  41. }
  42. }
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CTreeviewApp construction
  45. CTreeviewApp::CTreeviewApp()
  46. {
  47. cmdLineInfo = new CCmdLineInfo(*this);
  48. inFilename = NULL;
  49. }
  50. CTreeviewApp::~CTreeviewApp()
  51. {
  52. free(inFilename);
  53. delete cmdLineInfo;
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // The one and only CTreeviewApp object
  57. CTreeviewApp theApp;
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CTreeviewApp initialization
  60. BOOL CTreeviewApp::InitInstance()
  61. {
  62. // Standard initialization
  63. // If you are not using these features and wish to reduce the size
  64. // of your final executable, you should remove from the following
  65. // the specific initialization routines you do not need.
  66. if(!CWinApp::InitInstance()) return FALSE;
  67. ParseCommandLine(*cmdLineInfo);
  68. CPropertyInspector::registerClass();
  69. #ifdef _AFXDLL
  70. Enable3dControls(); // Call this when using MFC in a shared DLL
  71. #else
  72. Enable3dControlsStatic(); // Call this when linking to MFC statically
  73. #endif
  74. CTreeviewDlg dlg(inFilename);
  75. m_pMainWnd = &dlg;
  76. int nResponse = dlg.DoModal();
  77. if (nResponse == IDOK)
  78. {
  79. }
  80. else if (nResponse == IDCANCEL)
  81. {
  82. }
  83. return TRUE;
  84. }