maoyehu 2 tahun lalu
induk
melakukan
48e382aebe
1 mengubah file dengan 10 tambahan dan 5 penghapusan
  1. 10 5
      MFCApplication1/MFCApplication1Dlg.cpp

+ 10 - 5
MFCApplication1/MFCApplication1Dlg.cpp

@@ -101,20 +101,25 @@ DWORD WINAPI ProcessThread(void *param)
 	std::vector<tuple<string, string>> twoList;
 	std::vector<tuple<string, string>> errorList;
 	std::vector<tuple<string, string>> fourList;
-	int ret = AssignWordsFromTest(UnicodeToGB2312(pWnd->m_strTextPath), oneList, twoList, errorList, fourList);
+	int row = 0;
+	int ret = AssignWordsFromTest(UnicodeToGB2312(pWnd->m_strTextPath), oneList, twoList, errorList, fourList, row);
 	if (ret < 0)
 	{
-		static wstring erroArry[] = { L"关联文件不可用\r\n", L"两个文件行数不一致\r\n", 
-			L"原数据行空,内容行有数据\r\n", L"内容行空,原数据行有数据\r\n" };
+		static wchar_t* erroArry[] = { L"未找到答案文件,请校验\r\n", L"题干和答案行数不一致,请确认\r\n", 
+			L"题目文件中第%d行为空,请校验\r\n", L"答案文件中第%d行为空,请校验\r\n" };
 		wstring erro = L"未知错误";
+		wchar_t erro2[64] = { 0 };
+		wchar_t erro3[64] = { 0 };
+		_stprintf(erro2, erroArry[2], row);
+		_stprintf(erro3, erroArry[3], row);
 		switch (ret)
 		{
 		default:
 			break;
 		case -1:erro = erroArry[0]; break;
 		case -2:erro = erroArry[1]; break;
-		case -3:erro = erroArry[2]; break;
-		case -4:erro = erroArry[3]; break;
+		case -3:erro = erro2; break;
+		case -4:erro = erro3; break;
 		}
 		SendMessage(pWnd->m_hWnd, WM_SHOWINFO, (WPARAM)erro.c_str(), 1);
 		return 0L;