diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index cff804e..1faa31f 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -465,7 +465,7 @@ public: unsigned int l = sizeof(SANE_Int); ret = helper_->io_control(IO_CTRL_CODE_GET_SPEED_MODE, &num, &l); int save_num = 0; - wchar_t buf[128]; + if (fw_ == 3 || fw_ == 4 && num > 0 && num < 6) { if (num == 1)save_num = 40; @@ -477,19 +477,27 @@ public: else save_num = num; + wchar_t* infocat = NULL; if (num != speed_mode) { + wchar_t buf[30] = L"设置速度模式失败...现在速度是:"; type = false; - wcscat(buf, L"设置速度模式失败...现在速度是:"); - wcscat(buf, (wchar_t *)save_num); + wchar_t c[4]; + wsprintfW(c, L"%dppm", save_num); + + wcscat(buf, c); + infocat = buf; } else { + wchar_t buf[30] = L"设置速度模式成功...现在速度是:"; type = true; - wcscat(buf, L"设置速度模式成功...现在速度是:"); - wcscat(buf, (wchar_t*)save_num); + wchar_t c[6]; + wsprintfW(c,L"%dppm", save_num); + wcscat(buf, c); + infocat = buf; } - helper_->test_callback((wchar_t*)data, ui_helper::TEST_EVENT_RESULT, (void*)buf, type); + helper_->test_callback((wchar_t*)data, ui_helper::TEST_EVENT_RESULT, (void*)infocat, type); return SCANNER_ERR_OK; } /* 放置校正纸 */