diff --git a/device/win_usb/win_usb.cpp b/device/win_usb/win_usb.cpp index 49ade0c..2a2a027 100644 --- a/device/win_usb/win_usb.cpp +++ b/device/win_usb/win_usb.cpp @@ -10,6 +10,7 @@ //#include #include #include +#include // for STATUS_CANCELLED - 0xC0000120 #pragma comment(lib, "setupapi.lib") #pragma comment(lib, "hid.lib") @@ -78,7 +79,7 @@ std::wstring ansi2unicode(const char* ansi, UINT cp = CP_ACP) } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // OVERLAPPED ... -ovl_cls::ovl_cls() : ref_(1), io_bytes_(0) +ovl_cls::ovl_cls(uint32_t type) : ref_(1), io_bytes_(0), type_(type) { memset(&ovl_, 0, sizeof(ovl_)); ovl_.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); @@ -109,6 +110,14 @@ bool ovl_cls::is_waited(void) { return WaitForSingleObject(ovl_.hEvent, 0) == WAIT_OBJECT_0; } +void ovl_cls::notify(void) +{ + SetEvent(ovl_.hEvent); +} +uint32_t ovl_cls::type(void) +{ + return type_; +} ovl_mgr::ovl_mgr() {} @@ -118,14 +127,14 @@ ovl_mgr::~ovl_mgr() v->release(); } -ovl_cls* ovl_mgr::get_ovl(void) +ovl_cls* ovl_mgr::get_ovl(uint32_t type) { std::lock_guard lock(lock_); ovl_cls* o = NULL; for (auto& v : ovls_) { - if (v->is_waited()) + if (v->is_waited() && v->type() == type) { o = v; o->add_ref(); @@ -136,13 +145,18 @@ ovl_cls* ovl_mgr::get_ovl(void) if (!o) { - o = new ovl_cls(); + o = new ovl_cls(type); ovls_.push_back(o); o->add_ref(); } return o; } +void ovl_mgr::notify_all(void) +{ + for (auto& v : ovls_) + v->notify(); +} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // usb_device ... @@ -531,13 +545,7 @@ int usb_device::open(libusb_device_handle** dev_handle) if (!dev_desc_) init(); - HANDLE h = open_usb(udev_.name.c_str()); - if (h == INVALID_HANDLE_VALUE) - { - *dev_handle = NULL; - - return online_ ? LIBUSB_ERROR_IO : LIBUSB_ERROR_NO_DEVICE; - } + HANDLE h = INVALID_HANDLE_VALUE; USBSCAN_PIPE_CONFIGURATION upc = { 0 }; DWORD cbr = 0; @@ -555,6 +563,13 @@ int usb_device::open(libusb_device_handle** dev_handle) { VLOG_MINI_2(LOG_LEVEL_WARNING, "Nice: '%s' for '%s'.\r\n", root.c_str(), udev_.name.c_str()); } + h = open_usb(root.c_str()); + if (h == INVALID_HANDLE_VALUE) + { + *dev_handle = NULL; + + return online_ ? LIBUSB_ERROR_IO : LIBUSB_ERROR_NO_DEVICE; + } if (DeviceIoControl(h, IOCTL_GET_PIPE_CONFIGURATION, NULL, 0, &upc, sizeof(upc), &cbr, NULL)) { int type = PIPE_TYPE::WRITE_DATA_PIPE; @@ -588,6 +603,7 @@ int usb_device::close(void) CancelIo(pipes_[i].pipe); CloseHandle(pipes_[i].pipe); } + ovl_mgr_.notify_all(); pipes_.clear(); if (handle_) @@ -627,7 +643,7 @@ int usb_device::transfer_bulk(unsigned endpoint, unsigned char* data, int* lengt if (h) { - ovl_cls* oc = ovl_mgr_.get_ovl(); + ovl_cls* oc = ovl_mgr_.get_ovl(endpoint); DWORD io = 0; BOOL result = FALSE; @@ -652,11 +668,13 @@ int usb_device::transfer_bulk(unsigned endpoint, unsigned char* data, int* lengt { if (WaitForSingleObject(oc->over_lapped()->hEvent, timeout) == WAIT_OBJECT_0) { - GetOverlappedResult(h, oc->over_lapped(), oc->io_bytes(), FALSE); + GetOverlappedResult(h, oc->over_lapped(), oc->io_bytes(), TRUE); *length = *oc->io_bytes(); if (*length == 0 && oc->over_lapped()->Internal != ERROR_SUCCESS) { - ret = LIBUSB_ERROR_IO; + ret = oc->over_lapped()->Internal == STATUS_CANCELLED ? /*LIBUSB_ERROR_TRY_AGAIN*/LIBUSB_ERROR_INTERRUPTED : oc->over_lapped()->Internal; + if (ret == ERROR_NO_MORE_ITEMS) + ret = LIBUSB_ERROR_TIMEOUT; VLOG_MINI_2(LOG_LEVEL_WARNING, "Bulk-Transfer of endpoint 0x%02x failed with code 0x%08X\n", endpoint, oc->over_lapped()->Internal); } else @@ -692,7 +710,7 @@ int usb_device::transfer_control(uint8_t type, uint8_t req, uint16_t val, uint16 if ((HANDLE)handle_ != INVALID_HANDLE_VALUE) { DWORD io = 0; - ovl_cls *oc = ovl_mgr_.get_ovl(); + ovl_cls *oc = ovl_mgr_.get_ovl(0); irp.bmRequestType = (type >> 5) & 0x03; irp.bRequest = req; @@ -705,7 +723,7 @@ int usb_device::transfer_control(uint8_t type, uint8_t req, uint16_t val, uint16 { if (irp.fTransferDirectionIn) { - GetOverlappedResult((HANDLE)handle_, oc->over_lapped(), oc->io_bytes(), FALSE); + GetOverlappedResult((HANDLE)handle_, oc->over_lapped(), oc->io_bytes(), TRUE); ret = *oc->io_bytes(); } else @@ -742,7 +760,7 @@ int usb_device::transfer_interrupt(unsigned endpoint, unsigned char* data, int* *length = 0; if (h) { - ovl_cls* oc = ovl_mgr_.get_ovl(); + ovl_cls* oc = ovl_mgr_.get_ovl(endpoint); if (DeviceIoControl(h, IOCTL_WAIT_ON_DEVICE_EVENT, NULL, 0, data, len, oc->io_bytes(), oc->over_lapped())) { ret = LIBUSB_SUCCESS; @@ -755,7 +773,7 @@ int usb_device::transfer_interrupt(unsigned endpoint, unsigned char* data, int* { if (WaitForSingleObject(oc->over_lapped()->hEvent, timeout) == WAIT_OBJECT_0) { - GetOverlappedResult(h, oc->over_lapped(), oc->io_bytes(), FALSE); + GetOverlappedResult(h, oc->over_lapped(), oc->io_bytes(), TRUE); *length = *oc->io_bytes(); ret = LIBUSB_SUCCESS; } @@ -779,6 +797,17 @@ int usb_device::transfer_interrupt(unsigned endpoint, unsigned char* data, int* return ret; } +int usb_device::cancel_io(void) +{ + for (auto& v : pipes_) + { + CancelIo(v.pipe); + } + ovl_mgr_.notify_all(); + + return LIBUSB_SUCCESS; +} + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // usb_monitor ... @@ -1466,4 +1495,7 @@ uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device* device) return ((usb_device*)device)->address(); } - +int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer* transfer/*in windows, this is a libusb_device* object*/) +{ + return ((usb_device*)transfer)->cancel_io(); +} diff --git a/device/win_usb/win_usb.h b/device/win_usb/win_usb.h index 981a46d..558d11f 100644 --- a/device/win_usb/win_usb.h +++ b/device/win_usb/win_usb.h @@ -48,9 +48,10 @@ class ovl_cls// : public refer volatile long ref_; OVERLAPPED ovl_; DWORD io_bytes_; + uint32_t type_; public: - ovl_cls(); + ovl_cls(uint32_t type); protected: ~ovl_cls(); @@ -73,6 +74,8 @@ public: LPDWORD io_bytes(void); void reset(void); bool is_waited(void); + void notify(void); + uint32_t type(void); }; class ovl_mgr { @@ -84,7 +87,8 @@ public: ~ovl_mgr(); public: - ovl_cls* get_ovl(void); + ovl_cls* get_ovl(uint32_t type); + void notify_all(void); }; class usb_device // consider as libusb_device @@ -153,6 +157,8 @@ public: int transfer_bulk(unsigned endpoint, unsigned char* data, int* length, unsigned int timeout); int transfer_control(uint8_t type, uint8_t req, uint16_t val, uint16_t ind, unsigned char* data, uint16_t len, unsigned timeout); int transfer_interrupt(unsigned endpoint, unsigned char* data, int* length, unsigned int timeout); + + int cancel_io(void); }; class usb_callback { diff --git a/sane/DlgIndicator.cpp b/sane/DlgIndicator.cpp index 6df089f..560305a 100644 --- a/sane/DlgIndicator.cpp +++ b/sane/DlgIndicator.cpp @@ -197,7 +197,7 @@ void dlg_indicator::notify_working(void) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// dlg_choose_dev /// -dlg_choose_dev::dlg_choose_dev(HWND parent, const std::map& devs) : dlg_base(parent, IDD_CHOOSE_DEV), item_(-1) +dlg_choose_dev::dlg_choose_dev(HWND parent, const std::vector& devs) : dlg_base(parent, IDD_CHOOSE_DEV), item_(-1) { create(); @@ -218,11 +218,11 @@ dlg_choose_dev::dlg_choose_dev(HWND parent, const std::map::const_iterator it = devs.begin(); - it != devs.end(); ++it) + ind = 0; + for (const auto& v: devs) { - std::wstring n(local_trans::a2u(it->first.c_str(), CP_UTF8)), - s(local_trans::a2u(it->second.c_str(), CP_UTF8)); + std::wstring n(local_trans::a2u(v.name.c_str(), CP_UTF8)), + s(local_trans::a2u(v.sn.c_str(), CP_UTF8)); LV_ITEM item = { 0 }; int ind = 0; @@ -235,7 +235,7 @@ dlg_choose_dev::dlg_choose_dev(HWND parent, const std::map& devs); + dlg_choose_dev(HWND parent, const std::vector& devs); ~dlg_choose_dev(); public: diff --git a/sane/scanner.cpp b/sane/scanner.cpp index 29caaa2..6393e89 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -12,6 +12,7 @@ #include "DlgSetting.h" #include "gb_json.h" #include "../../sdk/include/lang/app_language.h" +#include #pragma comment(lib, "Shlwapi.lib") @@ -325,6 +326,51 @@ namespace callback else return to_default_language(in, nullptr); } + + + // UI ... + // + // events code, see SANE_Event + // + // callback events: SANE_EVENT_UI_CLOSE_CANCEL/SANE_EVENT_UI_CLOSE_NORMAL/SANE_EVENT_UI_SCAN_COMMAND/SANE_EVENT_UI_CLOSE_SETTING + // + // notify events: SANE_EVENT_WORKING - void*: unused, be NULL, flag - unused, be 0 + // SANE_EVENT_SCAN_FINISHED - void*: (utf8*)message, flag - error code (0 is success) + // SANE_EVENT_USB_DATA_RECEIVED- void* unused, be NULL, flag - unused, be 0 + // SANE_EVENT_IMAGE_OK - void* unused, be NULL, flag - unused, be 0 + int (*choose_scanner)(const std::vector& devs) = NULL; // blocked. return selected DEVQUE::id or -1 if user cancelled + void (*apply_current_config)(const char* dev_name, SANE_Handle device, LPSANEAPI api) = NULL; // 应用设备的当前配置 + void (*show_setting_ui)(SANE_Handle device, HWND parent, LPSANEAPI api, bool with_scan/*是否显示“扫描”按钮*/, std::function callback) = NULL; + void (*show_progress_ui)(HWND parent, std::function callback, std::function* notify) = NULL; + static void init_ui(void) + { + std::string root(hg_sane_middleware::sane_path()); + HMODULE mod = NULL; + + root += "twainui.dll"; + mod = LoadLibraryA(root.c_str()); + if (!mod) + { + std::wstring info(L"Load '" + local_trans::a2u(root.c_str(), CP_UTF8)); + + info += L"' failed: " + std::to_wstring(GetLastError()) + L"\r\n"; + + log_info(info.c_str(), 0); + } + else + { +#define GET_API(api) \ + proc = (FARPROC*)&api; \ + *proc = GetProcAddress(mod, #api); + + FARPROC* proc = NULL; + + GET_API(choose_scanner); + GET_API(apply_current_config); + GET_API(show_setting_ui); + GET_API(show_progress_ui); + } + } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -335,8 +381,25 @@ scanner::scanner(SCANNERID id) : handle_(NULL), id_(id), ex_id_(EXTENSION_ID_BAS , scanner_ev_handler_(NULL), evh_param_(NULL), app_wnd_(NULL), user_cancel_(false) , max_img_mem_(1 * 1024), twain_set_(false), ev_cnt_(0) { - cfg_ = new gb::scanner_cfg(); - cfg_->set_language_transform(&callback::language_trans, NULL); + sane_api_.sane_cancel_api = inner_sane_cancel; + sane_api_.sane_close_api = inner_sane_close; + sane_api_.sane_control_option_api = inner_sane_control_option; + sane_api_.sane_get_devices_api = inner_sane_get_devices; + sane_api_.sane_get_option_descriptor_api = inner_sane_get_option_descriptor; + sane_api_.sane_get_parameters_api = inner_sane_get_parameters; + sane_api_.sane_get_select_fd_api = inner_sane_get_select_fd; + sane_api_.sane_io_control_api = inner_sane_io_control; + sane_api_.sane_open_api = inner_sane_open; + sane_api_.sane_read_api = inner_sane_read; + sane_api_.sane_set_io_mode_api = inner_sane_set_io_mode; + sane_api_.sane_start_api = inner_sane_start; + sane_api_.sane_strstatus_api = inner_sane_strstatus; + + if (!callback::show_setting_ui) + { + cfg_ = new gb::scanner_cfg(); + cfg_->set_language_transform(&callback::language_trans, NULL); + } tmp_path_ = local_trans::a2u(hg_sane_middleware::sane_path().c_str()); { @@ -570,6 +633,9 @@ void scanner::transport_config_file(void) } void scanner::update_config(void) { + if (!cfg_) + return; + gb::sane_config_schm* schm = cfg_->get_scheme(); std::string notice(""); @@ -596,22 +662,31 @@ void scanner::update_config(void) } void scanner::load_config(const wchar_t* file) { - cfg_->load_file(local_trans::u2a(file).c_str()); - update_config(); + if (cfg_) + { + cfg_->load_file(local_trans::u2a(file).c_str()); + update_config(); + } } void scanner::save_config(const wchar_t* file) { - cfg_->save(local_trans::u2a(file).c_str()); + if(cfg_) + cfg_->save(local_trans::u2a(file).c_str()); } void scanner::apply_config(void) { - gb::sane_config_schm* schm = cfg_->get_scheme(); + if (callback::apply_current_config) + callback::apply_current_config(local_trans::u2a(scanner_name_.c_str(), CP_UTF8).c_str(), handle_, &sane_api_); + else if (cfg_) + { + gb::sane_config_schm* schm = cfg_->get_scheme(); - if (!schm) - return; + if (!schm) + return; - apply_scheme(schm); - schm->release(); + apply_scheme(schm); + schm->release(); + } } void scanner::on_ui_event(int uev, void* sender) { @@ -689,8 +764,9 @@ std::string scanner::choose_scanner(const std::vector& scanners) if (scanners.empty()) return ""; - std::map devs; + std::vector devs; std::string sel(""); + int id = 1; for (size_t i = 0; i < scanners.size(); ++i) { @@ -702,7 +778,13 @@ std::string scanner::choose_scanner(const std::vector& scanners) std::string sn(""); scanner::control_read_string(h, IO_CTRL_CODE_GET_SERIAL, sn); if (sn.length()) - devs[scanners[i]] = sn; + { + DEVQUE dev; + dev.id = id++; + dev.name = scanners[i]; + dev.sn = sn; + devs.push_back(dev); + } hg_sane_middleware::instance()->close_device(h); } } @@ -710,7 +792,22 @@ std::string scanner::choose_scanner(const std::vector& scanners) if (devs.size() == 0) sel = scanners[0]; else if (devs.size() == 1) - sel = devs.begin()->first; + sel = devs[0].name; + else if (callback::choose_scanner) + { + id = callback::choose_scanner(devs); + if (id != -1) + { + for (auto& v : devs) + { + if (v.id == id) + { + sel = v.name; + break; + } + } + } + } else { dlg_choose_dev dlg(NULL, devs); @@ -814,7 +911,7 @@ int scanner::init_options_id(void) default: break; } - if (len) + if (len && cfg_) { if (desc->type == SANE_TYPE_STRING) { @@ -2758,21 +2855,24 @@ COM_API_IMPLEMENT(scanner, void, twain_set_compression(SANE_CompressionType comp } COM_API_IMPLEMENT(scanner, int, twain_get_config(char* buf, size_t* len)) { - std::string cont(cfg_->to_text_stream()); - - if (*len < cont.length()) + if (cfg_) { - *len = cont.length() + 4; + std::string cont(cfg_->to_text_stream()); - return SCANNER_ERR_INSUFFICIENT_MEMORY; + if (*len < cont.length()) + { + *len = cont.length() + 4; + + return SCANNER_ERR_INSUFFICIENT_MEMORY; + } + strcpy(buf, cont.c_str()); } - strcpy(buf, cont.c_str()); return SCANNER_ERR_OK; } COM_API_IMPLEMENT(scanner, int, twain_set_config(char* buf, size_t len)) { - if(cfg_->load_mem(buf)) + if(cfg_ && cfg_->load_mem(buf)) { update_config(); apply_config(); @@ -2791,56 +2891,57 @@ 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)) { - SANEAPI api = { NULL }; - - if (with_scan) + if (callback::show_setting_ui) { - events_.clear(); - images_.clear(); - scan_msg_ = "OK"; - scan_err_ = false; + auto cb = [&](int ev) + { + on_ui_event(ev, NULL); + }; + callback::show_setting_ui(handle_, parent, &sane_api_, with_scan, cb); } - - api.sane_cancel_api = inner_sane_cancel; - api.sane_close_api = inner_sane_close; - api.sane_control_option_api = inner_sane_control_option; - api.sane_get_devices_api = inner_sane_get_devices; - api.sane_get_option_descriptor_api = inner_sane_get_option_descriptor; - api.sane_get_parameters_api = inner_sane_get_parameters; - api.sane_get_select_fd_api = inner_sane_get_select_fd; - api.sane_io_control_api = inner_sane_io_control; - api.sane_open_api = inner_sane_open; - api.sane_read_api = inner_sane_read; - api.sane_set_io_mode_api = inner_sane_set_io_mode; - api.sane_start_api = inner_sane_start; - api.sane_strstatus_api = inner_sane_strstatus; - - size_t pid = scanner_name_.find(L" - "); - if (pid == -1) - pid = scanner_name_.length(); - setting_.reset(new dlg_setting(parent, &api, handle_, with_scan, scanner_name_.substr(0, pid).c_str())); - setting_->set_ui_event_notify(&scanner::ui_callback, this); - setting_->set_config(cfg_, (cfg_path_ + scanner_name_.substr(0, pid) + L".cfg").c_str(), &scanner::apply_scheme, this, &twain_set_); - indicator_.reset(); - if (indicator) + else if (cfg_) { - indicator_.reset(new dlg_indicator(setting_->hwnd())); - indicator_->set_ui_event_notify(&scanner::ui_callback, this); + if (with_scan) + { + events_.clear(); + images_.clear(); + scan_msg_ = "OK"; + scan_err_ = false; + } + + size_t pid = scanner_name_.find(L" - "); + if (pid == -1) + pid = scanner_name_.length(); + setting_.reset(new dlg_setting(parent, &sane_api_, handle_, with_scan, scanner_name_.substr(0, pid).c_str())); + setting_->set_ui_event_notify(&scanner::ui_callback, this); + setting_->set_config(cfg_, (cfg_path_ + scanner_name_.substr(0, pid) + L".cfg").c_str(), &scanner::apply_scheme, this, &twain_set_); + indicator_.reset(); + if (indicator) + { + indicator_.reset(new dlg_indicator(setting_->hwnd())); + indicator_->set_ui_event_notify(&scanner::ui_callback, this); + } + setting_->show(true); } - setting_->show(true); return true; } COM_API_IMPLEMENT(scanner, bool, ui_show_progress(HWND parent)) { - if (setting_.get() && IsWindowVisible(setting_->hwnd())) - parent = setting_->hwnd(); - else if (!IsWindow(parent)) - parent = callback::find_main_wnd(); + if (callback::show_progress_ui) + { + } + else + { + if (setting_.get() && IsWindowVisible(setting_->hwnd())) + parent = setting_->hwnd(); + else if (!IsWindow(parent)) + parent = callback::find_main_wnd(); - indicator_.reset(new dlg_indicator(parent)); - indicator_->set_ui_event_notify(&scanner::ui_callback, this); - indicator_->show(true); + indicator_.reset(new dlg_indicator(parent)); + indicator_->set_ui_event_notify(&scanner::ui_callback, this); + indicator_->show(true); + } return true; } @@ -3060,6 +3161,8 @@ extern "C" int __stdcall initialize(void* reserve) { init_log(); + callback::init_ui(); + hg_sane_middleware::set_callback(callback::sane_event_callback, NULL); if (hg_sane_middleware::instance()->is_ready()) return SANE_STATUS_GOOD; diff --git a/sane/scanner.h b/sane/scanner.h index 6364d80..59fab90 100644 --- a/sane/scanner.h +++ b/sane/scanner.h @@ -56,6 +56,7 @@ class scanner : public ISaneInvoker, virtual public refer std::unique_ptr setting_; gb::scanner_cfg* cfg_; bool twain_set_; + SANEAPI sane_api_; int(__stdcall* scanner_ev_handler_)(int, void*); void* evh_param_; diff --git a/twain/twain.vcxproj b/twain/twain.vcxproj index 7883cd3..566b172 100644 --- a/twain/twain.vcxproj +++ b/twain/twain.vcxproj @@ -74,7 +74,7 @@ true - $(SolutionDir)..\..\sdk\include\;$(IncludePath) + $(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\sdk\include\twain\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(LibraryPath) @@ -84,13 +84,13 @@ $(LibraryPath) huagaotwain400.ds true - $(SolutionDir)..\..\sdk\include\;$(IncludePath) + $(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\sdk\include\twain\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ false - $(SolutionDir)..\..\sdk\include\;$(IncludePath) + $(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\sdk\include\twain\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(LibraryPath) @@ -100,7 +100,7 @@ $(LibraryPath) huagaotwain400.ds false - $(SolutionDir)..\..\sdk\include\;$(IncludePath) + $(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\sdk\include\twain\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ @@ -123,8 +123,12 @@ - - + copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\$(TargetName) /y +move /Y "$(TargetPath)" "$(OutputPath)$(TargetName)" +mkdir "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).lib" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).exp" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).pdb" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" @@ -147,8 +151,12 @@ - - + copy "$(TargetPath)" C:\Windows\twain_64\HuagoTwain\$(TargetName) /y +move /Y "$(TargetPath)" "$(OutputPath)$(TargetName)" +mkdir "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).lib" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).exp" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" +move /Y "$(OutputPath)$(TargetName).pdb" "$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao" @@ -206,52 +214,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/twain/twain.vcxproj.filters b/twain/twain.vcxproj.filters index 5d8a932..9f05408 100644 --- a/twain/twain.vcxproj.filters +++ b/twain/twain.vcxproj.filters @@ -33,129 +33,9 @@ - - twain - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - - - twain\twpp - twain - - twain - Headers @@ -174,6 +54,123 @@ Headers + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain\twpp + + + twain +