diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 6aae187..5aa7318 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1988,12 +1988,6 @@ void huagao_ds::init_support_caps(void) auto mech = data.currentItem(); if (Msg::Set == msg) { -#ifdef ARMY_SCANNER - if (mech >= 0 && mech <= 2) - val = mech; - else - val = COLOR_RGB; -#else if (mech == 1) val = COLOR_BW; else if (mech == 8) @@ -2002,7 +1996,6 @@ void huagao_ds::init_support_caps(void) val = COLOR_RGB; else val = COLOR_RGB; // mech; -#endif } { wchar_t info[128] = { 0 }; @@ -3711,7 +3704,19 @@ DWORD huagao_ds::get_config_number(const wchar_t* sec, const wchar_t* key, DWORD if (cfg_f.empty()) return empty; else - return GetPrivateProfileIntW(sec, key, def, get_config_file().c_str()); + { + DWORD val = GetPrivateProfileIntW(sec, key, def, cfg_f.c_str()); + if (val == def) + { + val = GetPrivateProfileIntW(sec, key, def + 2, cfg_f.c_str()); + if (val == def + 2) + val = empty; + else + val = def; + } + + return val; + } } int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) {