123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include <tchar.h>
- //---------------------------------------------------------------------------
- #include "AppGlobalF.h"
- #include "ITSDbF.h"
- #include "DMDbF.h"
- #include "ITSLangTransF.h"
- //---------------------------------------------------------------------------
- USEFORM("MAIN\FrmInitializeF.cpp", FrmInitialize);
- USEFORM("..\SRC\MAIN\FrmResourceF.cpp", FrmLang);
- USEFORM("MAIN\FRAME\FRAME_CctvStateListF.cpp", FRAMECctvStateList); /* TFrame: File Type */
- USEFORM("MAIN\FrmCctvCamCtrlF.cpp", FrmCctvCamCtrl);
- USEFORM("..\COMMON\DM\DMDbF.cpp", DMDb); /* TDataModule: File Type */
- //---------------------------------------------------------------------------
- WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
- {
- int nLoginRes;
- DateSeparator = '-';
- TimeSeparator = ':';
- ShortDateFormat ="yyyy-MM-dd";
- ShortTimeFormat = "hh:nn:ss";
- LongTimeFormat = "hh:nn:ss";
- cxFormatController()->BeginUpdate();
- cxFormatController()->UseDelphiDateTimeFormats = true;
- cxFormatController()->EndUpdate();
- cxFormatController()->GetFormats();
- cxFormatController()->NotifyListeners();
- String sLoginId = "ADMIN";
- bool bLogin = true;
- int nArgs = ParamCount();
- if (nArgs >= 1)
- {
- sLoginId = ParamStr(1);
- bLogin = false;
- }
- else return 0;
- int nRes;
- g_nPid = (int)GetCurrentProcessId();
- g_sAppDir = ExtractFilePath(Application->ExeName);
- g_sAppName = ChangeFileExt(ExtractFileName(Application->ExeName), "");
- g_sCfgDir = g_sAppDir + "Cfg\\";
- g_sLogDir = g_sAppDir + "Log\\";
- g_sTempDir = g_sAppDir + "Temp\\";
- g_sFormsDir = g_sCfgDir + "Forms\\";
- ForceDirectories(g_sCfgDir.c_str());
- ForceDirectories(g_sLogDir.c_str());
- ForceDirectories(g_sTempDir.c_str());
- ForceDirectories(g_sFormsDir.c_str());
- String sTempDir = g_sLogDir + "Db\\";
- ForceDirectories(sTempDir.c_str());
- String sAppDir = ExtractFilePath(Application->ExeName);
- ChDir(sAppDir);
- /*
- * 시스템 운영환경을 ini 파일에서 읽어 온다.
- */
- LoadDefaultConfigInfo("ITS_OP");
- g_sLangDir = g_sAppDir + "Lang\\";
- g_sLangDir = g_sLangDir + g_AppCfg.sLang + "\\";
- ForceDirectories(g_sLangDir.c_str());
- LangTrans = new TLangTrans("WebCamCtrl", g_AppCfg.sLang, g_sLangDir, true);
- ITSLog = new TITSLog(g_sLogDir, g_sAppName, g_AppCfg.sLogDay);
- ITSLog->FLogCfg = g_LogCfg;
- try
- {
- ReportMemoryLeaksOnShutdown = true;
- Application->Initialize();
- Application->MainFormOnTaskBar = true;
- Application->Title = g_AppCfg.sTitle;
- Application->Title = "CCTV(웹카메라) 제어";
- Application->CreateForm(__classid(TDMDb), &DMDb);
- Application->CreateForm(__classid(TFrmCctvCamCtrl), &FrmCctvCamCtrl);
- Application->CreateForm(__classid(TFrmLang), &FrmLang);
- Application->Run();
- }
- catch (Exception &exception)
- {
- Application->ShowException(&exception);
- }
- catch (...)
- {
- try
- {
- throw Exception("");
- }
- catch (Exception &exception)
- {
- Application->ShowException(&exception);
- }
- }
- prog_exit:
- try
- {
- }
- catch(...)
- {
- }
-
- return 0;
- }
- //---------------------------------------------------------------------------
|