From 693237e2ac37af3ecc2c6ce1121935a62a0eb129 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Sun, 6 Nov 2022 11:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=97=B6=E5=BA=93=E6=94=B9?= =?UTF-8?q?=E4=B8=BAMT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device/scanner.rc | 8 +-- device/scanner.vcxproj | 34 +++++----- sane/s2t_api.h | 34 ++++++---- sane/sane.rc | 8 +-- sane/sane.vcxproj | 7 +++ sane/scanner.cpp | 137 +++++++++++++++++++++-------------------- twain/twain.vcxproj | 17 ++--- 7 files changed, 134 insertions(+), 111 deletions(-) diff --git a/device/scanner.rc b/device/scanner.rc index cad428b..360552f 100644 --- a/device/scanner.rc +++ b/device/scanner.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,33,10000,22297 - PRODUCTVERSION 4,33,10000,22297 + FILEVERSION 4,34,10000,22310 + PRODUCTVERSION 4,34,10000,22310 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "宁波华高信息科技有限公司" VALUE "FileDescription", "华高扫描仪应用程序" - VALUE "FileVersion", "4.33.10000.22297" + VALUE "FileVersion", "4.34.10000.22310" VALUE "InternalName", "scanner.dll" VALUE "LegalCopyright", "Copyright (C) HUAGOScan 2022" VALUE "OriginalFilename", "scanner.dll" VALUE "ProductName", "HUAGOScan" - VALUE "ProductVersion", "4.33.10000.22297" + VALUE "ProductVersion", "4.34.10000.22310" END END BLOCK "VarFileInfo" diff --git a/device/scanner.vcxproj b/device/scanner.vcxproj index fb24562..2d2a991 100644 --- a/device/scanner.vcxproj +++ b/device/scanner.vcxproj @@ -72,15 +72,15 @@ true - $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath) - $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\code_device\hgdriver\ImageProcess\lib\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ false - $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath) - $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\code_device\hgdriver\ImageProcess\lib\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ @@ -88,15 +88,15 @@ true $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath) - $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) false $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath) - $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) @@ -105,15 +105,14 @@ WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;OEM_NONE;_DIRECT_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996 - MultiThreadedDebugDLL + MultiThreadedDebug stdcpp17 Console true - opencv_world3414.lib;IlmImf.lib;ittnotify.lib;leptonica.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;log4cplusS.lib;quirc.lib;tiff.lib;zbar.lib;zxing.lib;zlib.lib;user32.lib;libcrypto.lib;libssl.lib;cryptlib.lib - - + opencv_core3416.lib;opencv_imgproc3416.lib;opencv_imgcodecs3416.lib;IlmImf.lib;ittnotify.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;zlib.lib;user32.lib;cryptlib.lib + msvcprtd.lib; $(ProjectDir)device.def @@ -122,6 +121,7 @@ set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao mkdir %FINAL_DIR% copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" +copy "$(TargetPath)" F:\boxroom\HuaGoScan /y move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" @@ -138,13 +138,14 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true 4996 stdcpp17 + MultiThreaded Console true true true - opencv_world3414.lib;IlmImf.lib;ittnotify.lib;leptonica.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;log4cplusS.lib;quirc.lib;tiff.lib;zbar.lib;zxing.lib;zlib.lib;user32.lib;libssl.lib;cryptlib.lib + opencv_core3416.lib;opencv_imgproc3416.lib;opencv_imgcodecs3416.lib;IlmImf.lib;ittnotify.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;zlib.lib;user32.lib;cryptlib.lib $(ProjectDir)device.def @@ -168,18 +169,20 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true 4996; MultiThreadedDebug + stdcpp17 Console true msvcprtd.lib; - opencv_world3414.lib;IlmImf.lib;ittnotify.lib;leptonica.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;log4cplusS.lib;zlib.lib;user32.lib;libcrypto.lib;libssl.lib;cryptlib.lib + opencv_core3416.lib;opencv_imgproc3416.lib;opencv_imgcodecs3416.lib;IlmImf.lib;ittnotify.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;zlib.lib;user32.lib;cryptlib.lib $(ProjectDir)device.def set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao mkdir %FINAL_DIR% copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" +copy "$(TargetPath)" "C:\Program Files\HuaGoScan" move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" @@ -196,6 +199,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true 4996; MultiThreaded + stdcpp17 Console @@ -204,7 +208,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true - opencv_world3414.lib;IlmImf.lib;ittnotify.lib;leptonica.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;log4cplusS.lib;zlib.lib;user32.lib;libcrypto.lib;libssl.lib;cryptlib.lib + opencv_core3416.lib;opencv_imgproc3416.lib;opencv_imgcodecs3416.lib;IlmImf.lib;ittnotify.lib;libjasper.lib;libjpeg-turbo.lib;libpng.lib;libtiff.lib;libwebp.lib;zlib.lib;user32.lib;cryptlib.lib $(ProjectDir)device.def diff --git a/sane/s2t_api.h b/sane/s2t_api.h index 9aae19d..977078f 100644 --- a/sane/s2t_api.h +++ b/sane/s2t_api.h @@ -405,29 +405,37 @@ typedef unsigned int SCANNERID; #define GET_SCANNER_PID(sid) LOWORD(sid) #define GET_SCANNER_VID(sid) HIWORD(sid) +extern "C" +{ #ifdef EXPORT_SANE_API -__declspec(dllexport) + __declspec(dllexport) #else -__declspec(dllimport) + __declspec(dllimport) #endif -int __stdcall initialize(void* reserve); + int __stdcall initialize(void* reserve); #ifdef EXPORT_SANE_API -__declspec(dllexport) + __declspec(dllexport) #else -__declspec(dllimport) + __declspec(dllimport) #endif -int __stdcall open_scanner(SCANNERID scanner_id, ISaneInvoker** invoker); + int __stdcall open_scanner(SCANNERID scanner_id, ISaneInvoker** invoker); #ifdef EXPORT_SANE_API -__declspec(dllexport) + __declspec(dllexport) #else -__declspec(dllimport) + __declspec(dllimport) #endif -bool __stdcall is_scanner_online(SCANNERID scanner_id); + bool __stdcall is_scanner_online(SCANNERID scanner_id); #ifdef EXPORT_SANE_API -__declspec(dllexport) + __declspec(dllexport) #else -__declspec(dllimport) + __declspec(dllimport) #endif -int __stdcall uninitialize(void* reserve); - + int __stdcall uninitialize(void* reserve); +#ifdef EXPORT_SANE_API + __declspec(dllexport) +#else + __declspec(dllimport) +#endif + void __stdcall log_info(const wchar_t* info, int level); +} diff --git a/sane/sane.rc b/sane/sane.rc index 64436e9..8a9a40c 100644 --- a/sane/sane.rc +++ b/sane/sane.rc @@ -271,8 +271,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,33,10000,22297 - PRODUCTVERSION 4,33,10000,22297 + FILEVERSION 4,34,10000,22310 + PRODUCTVERSION 4,34,10000,22310 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -289,12 +289,12 @@ BEGIN BEGIN VALUE "CompanyName", "宁波华高信息科技有限公司" VALUE "FileDescription", "华高扫描仪应用程序" - VALUE "FileVersion", "4.33.10000.22297" + VALUE "FileVersion", "4.34.10000.22310" VALUE "InternalName", "sane.dll" VALUE "LegalCopyright", "Copyright (C) HUAGOScan 2022" VALUE "OriginalFilename", "sane.dll" VALUE "ProductName", "HUAGOScan" - VALUE "ProductVersion", "4.33.10000.22297" + VALUE "ProductVersion", "4.34.10000.22310" END END BLOCK "VarFileInfo" diff --git a/sane/sane.vcxproj b/sane/sane.vcxproj index f7eea9e..dca9fca 100644 --- a/sane/sane.vcxproj +++ b/sane/sane.vcxproj @@ -107,17 +107,21 @@ true stdcpp17 4996 + MultiThreadedDebug Console true %(AdditionalDependencies) $(ProjectDir)sane.def + + set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao mkdir %FINAL_DIR% copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" +copy "$(TargetPath)" F:\boxroom\HuaGoScan /y move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" @@ -134,6 +138,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true stdcpp17 4996 + MultiThreaded Console @@ -159,6 +164,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" _DEBUG;_CONSOLE;%(PreprocessorDefinitions);BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE true 4996 + MultiThreadedDebug Console @@ -185,6 +191,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" NDEBUG;_CONSOLE;%(PreprocessorDefinitions);BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE true 4996 + MultiThreaded Console diff --git a/sane/scanner.cpp b/sane/scanner.cpp index f3c856e..ae20501 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -2892,82 +2892,85 @@ void log(const wchar_t* info) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // exports -#ifdef EXPORT_SANE_API -__declspec(dllexport) -#else -__declspec(dllimport) -#endif -int __stdcall initialize(void* reserve) +extern "C" { - init_log(); - hg_sane_middleware::set_callback(callback::sane_event_callback, NULL); - hg_sane_middleware::instance(); - - return SANE_STATUS_GOOD; -} #ifdef EXPORT_SANE_API -__declspec(dllexport) + __declspec(dllexport) #else -__declspec(dllimport) + __declspec(dllimport) #endif -int __stdcall open_scanner(SCANNERID scanner_id, ISaneInvoker** invoker) -{ - if (!invoker) - return SCANNER_ERR_INVALID_PARAMETER; - - if (!is_scanner_online(scanner_id)) - return SCANNER_ERR_DEVICE_NOT_FOUND; - - scanner* scn = new scanner(scanner_id); - if (scn->last_error() == SCANNER_ERR_OK) + int __stdcall initialize(void* reserve) { - *invoker = dynamic_cast(scn); + init_log(); + hg_sane_middleware::set_callback(callback::sane_event_callback, NULL); + hg_sane_middleware::instance(); + + return SANE_STATUS_GOOD; + } +#ifdef EXPORT_SANE_API + __declspec(dllexport) +#else + __declspec(dllimport) +#endif + int __stdcall open_scanner(SCANNERID scanner_id, ISaneInvoker** invoker) + { + if (!invoker) + return SCANNER_ERR_INVALID_PARAMETER; + + if (!is_scanner_online(scanner_id)) + return SCANNER_ERR_DEVICE_NOT_FOUND; + + scanner* scn = new scanner(scanner_id); + if (scn->last_error() == SCANNER_ERR_OK) + { + *invoker = dynamic_cast(scn); + + return 0; + } + else + { + int ret = scn->last_error(); + + scn->release(); + *invoker = NULL; + + return ret; + } + } +#ifdef EXPORT_SANE_API + __declspec(dllexport) +#else + __declspec(dllimport) +#endif + bool __stdcall is_scanner_online(SCANNERID scanner_id) + { + std::vector que; + + scanner::get_scanner_name(scanner_id, que); + + return !que.empty(); + } +#ifdef EXPORT_SANE_API + __declspec(dllexport) +#else + __declspec(dllimport) +#endif + int __stdcall uninitialize(void* reserve) + { + hg_sane_middleware::set_callback(NULL, NULL); + hg_sane_middleware::clear(); + close_log(); return 0; } - else +#ifdef EXPORT_SANE_API + __declspec(dllexport) +#else + __declspec(dllimport) +#endif + void __stdcall log_info(const wchar_t* info, int level) { - int ret = scn->last_error(); - - scn->release(); - *invoker = NULL; - - return ret; + log(info); } -} -#ifdef EXPORT_SANE_API -__declspec(dllexport) -#else -__declspec(dllimport) -#endif -bool __stdcall is_scanner_online(SCANNERID scanner_id) -{ - std::vector que; - - scanner::get_scanner_name(scanner_id, que); - return !que.empty(); } -#ifdef EXPORT_SANE_API -__declspec(dllexport) -#else -__declspec(dllimport) -#endif -int __stdcall uninitialize(void* reserve) -{ - hg_sane_middleware::set_callback(NULL, NULL); - hg_sane_middleware::clear(); - close_log(); - - return 0; -} -#ifdef EXPORT_SANE_API -__declspec(dllexport) -#else -__declspec(dllimport) -#endif -void __stdcall log_info(const wchar_t* info, int level) -{ - log(info); -} - diff --git a/twain/twain.vcxproj b/twain/twain.vcxproj index fe60c05..192cf98 100644 --- a/twain/twain.vcxproj +++ b/twain/twain.vcxproj @@ -78,11 +78,11 @@ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(LibraryPath) - huagaotwain402.ds + huagaotwain400.ds $(LibraryPath) - huagaotwain402.ds + huagaotwain400.ds true $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ @@ -94,11 +94,11 @@ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(LibraryPath) - huagaotwain402.ds + huagaotwain400.ds $(LibraryPath) - huagaotwain402.ds + huagaotwain400.ds false $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ @@ -113,7 +113,7 @@ true 4996 pch.h - MultiThreadedDebugDLL + MultiThreadedDebug Console @@ -129,7 +129,7 @@ move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" -copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoScan" /y +copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoTwain\x86" /y @@ -141,7 +141,7 @@ copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoScan" /ytrue 4996 pch.h - MultiThreadedDebugDLL + MultiThreadedDebug /bigobj %(AdditionalOptions) @@ -219,7 +219,8 @@ mkdir "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" -move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" +move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" +copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_64\HuaGoScan" /y