diff --git a/device/scanner.vcxproj b/device/scanner.vcxproj
index 0d68a59..6288c6c 100644
--- a/device/scanner.vcxproj
+++ b/device/scanner.vcxproj
@@ -118,8 +118,7 @@
-
-
+ copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\ /Y
diff --git a/sane/sane.vcxproj b/sane/sane.vcxproj
index 8834c97..8be8fd2 100644
--- a/sane/sane.vcxproj
+++ b/sane/sane.vcxproj
@@ -118,8 +118,7 @@
-
-
+ copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\$(TargetName) /y
diff --git a/sane/scanner.cpp b/sane/scanner.cpp
index c7a181c..0457d00 100644
--- a/sane/scanner.cpp
+++ b/sane/scanner.cpp
@@ -2904,11 +2904,11 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_main(HWND parent))
COM_API_IMPLEMENT(scanner, bool, ui_show_setting(HWND parent, bool with_scan, bool indicator))
{
is_show_ui_ = with_scan;
+ events_.clear();
if (callback::show_setting_ui)
{
if (with_scan)
{
- events_.clear();
images_.clear();
scan_msg_ = "OK";
scan_err_ = false;
diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp
index ab38b02..49deed6 100644
--- a/twain/twain/huagaods.cpp
+++ b/twain/twain/huagaods.cpp
@@ -3456,8 +3456,8 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
//notifyCloseOk();
//break;
case SANE_EVENT_UI_CLOSE_SETTING:
- notifyCloseCancel();
- if (ev == SANE_EVENT_UI_CLOSE_SETTING)
+ rc = notifyCloseCancel();
+ if (!Twpp::success(rc))
{
rc = notifyXferReady(); // 好分数需要再通知 FAINT :( - modified on 2022-10-20
if (!Twpp::success(rc))
@@ -3466,6 +3466,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
swprintf_s(msg, _countof(msg) - 1, L"[%x]yscan: notifyXferReady failed after setting UI closed with error %d\r\n", GetCurrentThreadId(), rc);
load_sane_util::log_info(msg, 0);
}
+ rc = notifyCloseCancel();
}
break;
case SANE_EVENT_UI_SCAN_COMMAND: