Closed borjafg closed 3 years ago
It's been a while since I ran the Java binding, but the dtwainjni32u.dll
has dependencies on dtwain32u.dll
, not dtwain32.dll
.
You probably need to have dtwain32u.dll
available on the system path.
Thanks.
Now it loads the library but it shows me another error in a cmd window when I run DTwainJavaCapDemo:
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] ===>>> DTWAIN_GetVersionEx(lMajor=00DBF708, lMinor=00DBF70C, lVersionType=00DBF714, lPatchLevel=00DBF710)
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] ===>>> DTWAIN_GetVersionInternal(lMajor=00DBF708, lMinor=00DBF70C, lVersionType=00DBF714)
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] <<<=== DTWAIN_GetVersionInternal 1
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] <<<=== DTWAIN_GetVersionEx 1
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] ===>>> DTWAIN_GetStaticLibVersion()
[2021-03-20 17:16:10.467968] [0x0000389c] [trace] [2021-03-20 17:16:10] <<<=== DTWAIN_GetStaticLibVersion 0
[2021-03-20 17:16:10.468969] [0x0000389c] [trace] [2021-03-20 17:16:10] <<<=== DTWAIN_SetTwainLog 1
[2021-03-20 17:16:10.468969] [0x0000389c] [trace] [2021-03-20 17:16:10] ===>>> DTWAIN_EnableMsgNotify(bSet=1)
[2021-03-20 17:16:10.468969] [0x0000389c] [trace] [2021-03-20 17:16:10] ===>>> DTWAIN_GetErrorString(lError=-1001, lpszBuffer=?, nMaxLen=1024)
[2021-03-20 17:16:10.469972] [0x0000389c] [trace] [2021-03-20 17:16:10] <<<=== DTWAIN_GetErrorString 0
[2021-03-20 17:16:10.469972] [0x0000389c] [trace] [2021-03-20 17:16:10] ?
[2021-03-20 17:16:27.395720] [0x0000389c] [trace] [2021-03-20 17:16:27] ===>>> DTWAIN_SelectSource()
[2021-03-20 17:16:27.395720] [0x0000389c] [trace] [2021-03-20 17:16:27] ===>>> dynarithmic::SourceSelect(options=whichOption=1, productName=null, parentWindow=00000000, title=null, xPos=0, yPos=0, includeNames=null, excludeNames=null, nameMapping=null, options=0)
[2021-03-20 17:16:27.396717] [0x0000389c] [trace] [2021-03-20 17:16:27] ===>>> DTWAIN_GetErrorString(lError=-1001, lpszBuffer=, nMaxLen=1024)
[2021-03-20 17:16:27.396717] [0x0000389c] [trace] [2021-03-20 17:16:27] <<<=== DTWAIN_GetErrorString 0
Please see the main page for this error. It is explained there. There are text files that contains the resource strings, and DTWAIN does not find them.
Thanks. Now the program runs without errors.
Glad to be of help.
Just as a note: The Java bindings may not have all of the recently added DTWAIN functions. The only functions available are the native ones you see in DTwainJavaAPI.java.
To add any new functions requires changes to the C++ JNI layer and the Java interface. I haven't had the time to update the Java bindings lately, but hopefully I can get around to doing so at some point.
I created a project using eclipse (version 2020_06) and a JDK 8 (version 241 - 32 Bits). When I tried to load the library it gives me this error:
Using a program to search the dependencies of the library I saw it needs "dtwain32.dll".
I took the library from your repository but it gives the same error.
I ran "DTWDEMO32.exe" and "DTWDEMO32U.exe" and both worked fine, so the problem must be in the java code or "dtwainjni32u.dll".
This is the java project I am using for testing to the issue. I used the source code from your repository.
ScannerTest.zip
And this is the configuration I used to launch the test.