WebCamViewer.cpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <tchar.h>
  5. //---------------------------------------------------------------------------
  6. #include "AppGlobalF.h"
  7. #include "ITSDbF.h"
  8. #include "DMDbF.h"
  9. #include "ITSLangTransF.h"
  10. //---------------------------------------------------------------------------
  11. USEFORM("MAIN\FrmCameraFullScreenF.cpp", FrmCameraFullScreen);
  12. USEFORM("MAIN\FrmCameraScreenManagerF.cpp", FrmCameraScreenManager);
  13. USEFORM("MAIN\FrmCameraInfoF.cpp", FrmCameraInfo);
  14. USEFORM("MAIN\FrmInitializeF.cpp", FrmInitialize);
  15. USEFORM("MAIN\FrmCameraScreenF.cpp", FrmCameraScreen);
  16. USEFORM("MAIN\FrmWebCamViewerF.cpp", FrmWebCamViewer);
  17. USEFORM("..\COMMON\DM\DMDbF.cpp", DMDb); /* TDataModule: File Type */
  18. USEFORM("MAIN\FrmCameraPlayerF.cpp", FrmCameraPlayer);
  19. USEFORM("MAIN\FRAME\FRAME_ObjListF.cpp", FRAMEObjList); /* TFrame: File Type */
  20. //---------------------------------------------------------------------------
  21. WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
  22. {
  23. int nLoginRes;
  24. DateSeparator = '-';
  25. TimeSeparator = ':';
  26. ShortDateFormat ="yyyy-MM-dd";
  27. ShortTimeFormat = "hh:nn:ss";
  28. LongTimeFormat = "hh:nn:ss";
  29. String sLoginId = "ADMIN";
  30. bool bLogin = true;
  31. int nArgs = ParamCount();
  32. if (nArgs >= 1)
  33. {
  34. sLoginId = ParamStr(1);
  35. bLogin = false;
  36. }
  37. int nRes;
  38. g_nPid = (int)GetCurrentProcessId();
  39. g_sAppDir = ExtractFilePath(Application->ExeName);
  40. g_sAppName = ChangeFileExt(ExtractFileName(Application->ExeName), "");
  41. g_sCfgDir = g_sAppDir + "Cfg\\";
  42. g_sLogDir = g_sAppDir + "Log\\";
  43. g_sTempDir = g_sAppDir + "Temp\\";
  44. g_sFormsDir = g_sCfgDir + "Forms\\";
  45. ForceDirectories(g_sCfgDir.c_str());
  46. ForceDirectories(g_sLogDir.c_str());
  47. ForceDirectories(g_sTempDir.c_str());
  48. ForceDirectories(g_sFormsDir.c_str());
  49. String sTempDir = g_sLogDir + "Db\\";
  50. ForceDirectories(sTempDir.c_str());
  51. String sAppDir = ExtractFilePath(Application->ExeName);
  52. ChDir(sAppDir);
  53. /*
  54. * 시스템 운영환경을 ini 파일에서 읽어 온다.
  55. */
  56. LoadDefaultConfigInfo("ITS_OP");
  57. g_sLangDir = g_sAppDir + "Lang\\";
  58. g_sLangDir = g_sLangDir + g_AppCfg.sLang + "\\";
  59. ForceDirectories(g_sLangDir.c_str());
  60. LangTrans = new TLangTrans("WebCamViewer", g_AppCfg.sLang, g_sLangDir, true);
  61. ITSLog = new TITSLog(g_sLogDir, g_sAppName, g_AppCfg.sLogDay);
  62. ITSLog->FLogCfg = g_LogCfg;
  63. try
  64. {
  65. ReportMemoryLeaksOnShutdown = true;
  66. Application->Initialize();
  67. Application->MainFormOnTaskBar = true;
  68. Application->Title = g_AppCfg.sTitle;
  69. Application->Title = "웹카메라 영상 모니터링";
  70. Application->CreateForm(__classid(TFrmWebCamViewer), &FrmWebCamViewer);
  71. Application->CreateForm(__classid(TDMDb), &DMDb);
  72. Application->Run();
  73. }
  74. catch (Exception &exception)
  75. {
  76. Application->ShowException(&exception);
  77. }
  78. catch (...)
  79. {
  80. try
  81. {
  82. throw Exception("");
  83. }
  84. catch (Exception &exception)
  85. {
  86. Application->ShowException(&exception);
  87. }
  88. }
  89. prog_exit:
  90. try
  91. {
  92. }
  93. catch(...)
  94. {
  95. }
  96. return 0;
  97. }
  98. //---------------------------------------------------------------------------