Browse Source

【软件版本】
V
【模块名称】
远程场测工具
【问题原因】
解决无配置文件时程序崩溃的问题。
【修改描述】

【测试结果】

sat23 3 years ago
parent
commit
cb4aec94a5
1 changed files with 6 additions and 0 deletions
  1. 6 0
      TestWizardTool/TestWizardTool/Global.cpp

+ 6 - 0
TestWizardTool/TestWizardTool/Global.cpp

@@ -234,6 +234,12 @@ namespace Global
 		TCHAR szConfigpath[MAX_PATH] = { 0 };
 		_stprintf_s(szConfigpath, _T("%s%s.ini"), g_szCurModuleDir, g_szFna);
 		_tcscpy_s(g_szConfig, szConfigpath);
+        ASSERT(PathFileExists(szConfigpath));
+        if ( !PathFileExists(szConfigpath) )
+        {
+            AfxMessageBox(_T("The default configuration file is missing"));
+            return;
+        }
 
 		TCHAR szValue[MAX_PATH] = { 0 };
 		g_Config.nLanguage = GetPrivateProfileInt(_T("SATHelper"), _T("Language"), 0, szConfigpath);