From 0b5aeff5ab3bf559e3743da9d1dfc96b63022795 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Fri, 17 Nov 2023 16:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=88=86=E6=95=B0=EF=BC=8C=E5=86=9B?= =?UTF-8?q?=E9=98=9F=E6=89=AB=E6=8F=8F=E9=87=87=E7=94=A8UTF8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twain/ds/huagaods.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/twain/ds/huagaods.cpp b/twain/ds/huagaods.cpp index 364b3e9..df1c5ca 100644 --- a/twain/ds/huagaods.cpp +++ b/twain/ds/huagaods.cpp @@ -1002,11 +1002,18 @@ Result huagao_ds::identityOpenDs(const Identity& id) if (double_check_mode_ == 0) { char pe[MAX_PATH] = { 0 }, * name = NULL; + std::string utf8(""); + GetModuleFileNameA(NULL, pe, _countof(pe) - 1); name = strrchr(pe, '\\'); if (name++ == NULL) name = pe; - if (STRICMP(name, "\u597D\u5206\u6570\u9605\u5377\u626B\u63CF\u7AEF.exe") == 0) +#ifdef WIN32 + utf8 = utils::ansi2utf8(name); +#else + utf8 = name; +#endif + if (STRICMP(utf8.c_str(), "\345\245\275\345\210\206\346\225\260\351\230\205\345\215\267\346\211\253\346\217\217\347\253\257.exe") == 0) double_check_mode_ = DOUBLE_CHECK_ULTRASONIC; else double_check_mode_ = DOUBLE_CHECK_TWAIN; @@ -1017,11 +1024,18 @@ Result huagao_ds::identityOpenDs(const Identity& id) if (nobd == -1) { char pe[MAX_PATH] = { 0 }, * name = NULL; + std::string utf8(""); + GetModuleFileNameA(NULL, pe, _countof(pe) - 1); name = strrchr(pe, '\\'); if (name++ == NULL) name = pe; - if (STRICMP(name, "\u519B\u961F\u626B\u63CF2.0.exe") == 0) // 军队扫描2.0.exe +#ifdef WIN32 + utf8 = utils::ansi2utf8(name); +#else + utf8 = name; +#endif + if (STRICMP(name, "\345\206\233\351\230\237\346\211\253\346\217\2172.0.exe") == 0) // 军队扫描2.0.exe nobd = 1; else nobd = 0; @@ -1247,7 +1261,7 @@ Result huagao_ds::imageInfoGet(const Identity&, ImageInfo& data) //if (!scanner_->wait_image()) //{ //// notifyCloseOk(); - // return success(); // 好分数需要返回成�? + // return success(); // 好分数需要返回成? //} if (get_scanned_image_count(-1) > 0) // 显示设置界面时,不能阻塞在EndXfer,否则最后一张图片传输后显示不出来,故在此做阻塞调用 { @@ -1654,7 +1668,7 @@ Result huagao_ds::call(const Identity& origin, DataGroup dg, Dat dat, Msg msg, v Result rt; char dgs[20] = { 0 }, dts[20] = { 0 }, ms[20] = { 0 }, ss[20] = { 0 }, rcs[20] = { 0 }, cs[20] = { 0 }; - //trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 云阅卷扫描端不等状态改变,直接取图,此处设置一次状�?2022-11-07 + //trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 云阅卷扫描端不等状态改变,直接取图,此处设置一次状?2022-11-07 rt = Base::call(origin, dg, dat, msg, data); if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent)) @@ -3869,7 +3883,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) break; case SANE_EVENT_UI_CLOSE_CANCEL: //scanner_->stop(); - //notifyCloseCancel(); // 修复点击进度�?取消"按钮,UI不能正常结束的BUG - added on 2023-02-14 + //notifyCloseCancel(); // 修复点击进度?取消"按钮,UI不能正常结束的BUG - added on 2023-02-14 //break; case SANE_EVENT_UI_CLOSE_NORMAL: case SANE_EVENT_SCAN_FINISHED: