//--------------------------------------------------------------------------- #include #pragma hdrstop #include #include //--------------------------------------------------------------------------- #include "AppGlobalF.h" //#include "ResourceMsgF.h" #include "ITSDbF.h" //--------------------------------------------------------------------------- USEFORM("MAIN\FrmLangEditF.cpp", FrmLangEdit); //--------------------------------------------------------------------------- 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(); g_sAppDir = ExtractFilePath(Application->ExeName); g_sAppName = ChangeFileExt(ExtractFileName(Application->ExeName), ""); g_sCfgDir = g_sAppDir + "Cfg\\"; g_sLogDir = g_sAppDir + "Log\\"; g_sFormsDir = g_sCfgDir + "Forms\\"; ForceDirectories(g_sCfgDir.c_str()); ForceDirectories(g_sLogDir.c_str()); String sTempDir = g_sLogDir + "Db\\"; ForceDirectories(sTempDir.c_str()); String sAppDir = ExtractFilePath(Application->ExeName); ChDir(sAppDir); /* * ½Ã½ºÅÛ ¿î¿µÈ¯°æÀ» ini ÆÄÀÏ¿¡¼­ ÀÐ¾î ¿Â´Ù. */ LoadDefaultConfigInfo("ITS_OP"); ITSLog = new TITSLog(g_sLogDir, g_sAppName, g_AppCfg.sLogDay); ITSLog->FLogCfg = g_LogCfg; if (!ITSDb_Initialize()) { if (g_AppCfg.sLang == "kr") { Application->MessageBox(L"Database ÀÚ¿øÀ» ½Ã½ºÅÛÀ¸·ÎºÎÅÍ ¾òÁö ¸øÇß½À´Ï´Ù.\r\n\r\nÇÁ·Î±×·¥À» Á¾·áÇÕ´Ï´Ù.", L"ÇÁ·Î±×·¥ ½ÃÀÛ ¿À·ù!!!", MB_OK|MB_ICONERROR); } else { Application->MessageBox(L"Database resource could not be obtained from the system.\r\n\r\nExit the program.", L"Program Start Error!!!", MB_OK|MB_ICONERROR); } goto prog_exit; } ITSDb_SetInfo(g_AppCfg.itsdb.sProvider, g_AppCfg.itsdb.sServerName, g_AppCfg.itsdb.sUserName, g_AppCfg.itsdb.sPassword); if (!ITSDb_Open()) { if (g_AppCfg.sLang == "kr") { Application->MessageBox(L"µ¥ÀÌÅͺ£À̽º Á¢¼Ó¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.\r\n\r\nÇÁ·Î±×·¥À» Á¾·áÇÕ´Ï´Ù.", L"ÇÁ·Î±×·¥ ½ÃÀÛ ¿À·ù!!!", MB_OK|MB_ICONERROR); } else { Application->MessageBox(L"Database connection failed.\r\n\r\nExit the program.", L"Program Start Error!!!", MB_OK|MB_ICONERROR); } goto prog_exit; } try { ReportMemoryLeaksOnShutdown = true; Application->Initialize(); Application->MainFormOnTaskBar = true; Application->Title = g_AppCfg.sTitle; Application->Title = " ITS Language Resouce Editor"; Application->CreateForm(__classid(TFrmLangEdit), &FrmLangEdit); Application->Run(); } catch (Exception &exception) { Application->ShowException(&exception); } catch (...) { try { throw Exception(""); } catch (Exception &exception) { Application->ShowException(&exception); } } prog_exit: try { ITSDb_Finalize(); } catch(...) { } return 0; } //---------------------------------------------------------------------------