VmsMsgSendDisp.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <tchar.h>
  5. #include <cxFormats.hpp>
  6. //---------------------------------------------------------------------------
  7. #include "AppGlobalF.h"
  8. #include "ITSDbF.h"
  9. #include "FrmVmsMsgSendDispF.h"
  10. //---------------------------------------------------------------------------
  11. USEFORM("SRC\FrmVmsMsgSendDispF.cpp", FrmVmsMsgSendDisp);
  12. //---------------------------------------------------------------------------
  13. WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
  14. {
  15. if (!CheckApplicationParam()) {
  16. return 0;
  17. }
  18. if (!ApplicationSingleRun("TFrmVmsMsgSendDisp", "VMS 메시지 수동표출 - (DB 장애)")) {
  19. return 0;
  20. }
  21. DateSeparator = '-';
  22. TimeSeparator = ':';
  23. ShortDateFormat ="yyyy-MM-dd";
  24. ShortTimeFormat = "hh:nn:ss";
  25. LongTimeFormat = "hh:nn:ss";
  26. cxFormatController()->BeginUpdate();
  27. cxFormatController()->UseDelphiDateTimeFormats = true;
  28. cxFormatController()->EndUpdate();
  29. cxFormatController()->GetFormats();
  30. cxFormatController()->NotifyListeners();
  31. g_nPid = (int)GetCurrentProcessId();
  32. g_sAppDir = ExtractFilePath(Application->ExeName);
  33. g_sAppName = ChangeFileExt(ExtractFileName(Application->ExeName), "");
  34. g_sCfgDir = g_sAppDir + g_IniFileDir + "\\";
  35. g_sLogDir = g_sAppDir + "Log\\";
  36. ForceDirectories(g_sLogDir.c_str());
  37. ChDir(g_sAppDir);
  38. /*
  39. * 시스템 운영환경을 ini 파일에서 읽어 온다.
  40. */
  41. LoadDefaultConfigInfo(g_IniFileName);
  42. ITSLog = new TITSLog(g_sLogDir, g_sAppName, g_AppCfg.sLogDay);
  43. ITSLog->FLogCfg = g_LogCfg;
  44. try
  45. {
  46. ReportMemoryLeaksOnShutdown = true;
  47. Application->Initialize();
  48. Application->MainFormOnTaskBar = true;
  49. Application->Title = g_AppCfg.sTitle;
  50. Application->Title = "VMS 메시지 수동표출 - (DB 장애)";
  51. Application->CreateForm(__classid(TFrmVmsMsgSendDisp), &FrmVmsMsgSendDisp);
  52. Application->Run();
  53. }
  54. catch (Exception &exception)
  55. {
  56. Application->ShowException(&exception);
  57. }
  58. catch (...)
  59. {
  60. try
  61. {
  62. throw Exception("");
  63. }
  64. catch (Exception &exception)
  65. {
  66. Application->ShowException(&exception);
  67. }
  68. }
  69. return 0;
  70. }
  71. //---------------------------------------------------------------------------