dynarithmic / twain_library-java

Apache License 2.0
12 stars 4 forks source link

Run new TwainSession(); Have a problem #16

Open Limruu opened 2 months ago

Limruu commented 2 months ago

hello,According to the sample code to run, appear com. Dynarithmic. Twain. Exceptions. DTwainJavaAPIException: twain Session Could not start.The following image: image If you know this problem, please help me

dynarithmic commented 2 months ago

There is an issue with your TWAIN setup. Starting a TWAIN session should only fail if for some reason, TWAINDSM.DLL does not exist, cannot be found, cannot be opened, or corrupted in some way.

Note that you are running a 64-bit application, not 32-bit. This means that TWAINDSM.DLL is the Twain Data Source manager that is loaded. Do you have this file existing where it can be found and opened? Are you actually trying to communicate with 64-bit TWAIN drivers and not 32-bit drivers? If you are not trying to communicate with 64-bit drivers, then you should not be using dtwainjni64u.dll, but instead use dtwainjni32u.dll.

For 32-bit applications, every Windows version has TWAIN_32.DLL installed automatically, so there is no issue for 32-bit applications, but for 64-bit applications, TWAINDSM.DLL requires you (or another TWAIN driver) to install this file.

If you ran the DTWDEMO.exe program that exists in the main DTWAIN repository, does that work correctly?