List Of Available Devices is Always 0

Questions, comments and suggestions concerning VintaSoft Twain ActiveX.

Moderator: Alex

daniele.frisenna
Posts: 8
Joined: Tue Jul 23, 2019 1:13 pm

List Of Available Devices is Always 0

Post by daniele.frisenna » Tue Jul 23, 2019 1:36 pm

Hello.
I try to use VintaSoft Twain ActiveX with Power Buider 11.5 IDE.
After porting your base VB.Net code from Advanced Demo to Power Script and test it on my developer PC, always run OK like Advanced Demo.

At this time I decide to test my Power Buider compiled project in a second PC (production test pc) following your instruction about ActiveX control registration, using this script:
-------------------------
@echo off
cd \
cd C:\Windows\SysWOW64
Regsvr32 /U /S "C:\LOGICA\Ecos e-one\Runtime\VSTwain.dll"
Regsvr32 /I /S "C:\LOGICA\Ecos e-one\Runtime\VSTwain.dll"
-------------------------
The result give me the possibility to correctly open Device Manager but, when I try to list available devices, this property: DeviceManager_DeviceCount is always equal to zero and I cannot iterate to real available devices and I cannot use any functionality such as Acquire Image, save, ecc.
Instead, If I try to run Advanced Demo on the same machine I correctly see the available device list.

My PC
OS: Windows 10 pro
ActiveX: VSTwain6

Production Test PC
OS: Windows 10 pro
ActiveX: VSTwain6

I need your support to resolve this problem before try test again !!!!

Alex
Site Admin
Posts: 1730
Joined: Thu Jul 10, 2008 2:21 pm

Re: List Of Available Devices is Always 0

Post by Alex » Tue Jul 23, 2019 2:13 pm

Hello Daniele,
... DeviceManager_DeviceCount is always equal to zero ...
...If I try to run Advanced Demo on the same machine I correctly see the available device list...
TWAIN Advanced Demo is 32-bit application and it shows a list of 32-bit TWAIN/WIA drivers installed in your system.

Your application shows an empty list and this means that your application is 64-bit application and your system does not have installed 64-bit TWAIN drivers. Please check this.

Best regards, Alexander

daniele.frisenna
Posts: 8
Joined: Tue Jul 23, 2019 1:13 pm

Re: List Of Available Devices is Always 0

Post by daniele.frisenna » Tue Jul 23, 2019 3:39 pm

Hello Alex.
Power Builder compiler generate only 32-bit application and not 64-bit.
Also how you explain that new 32-bit recompiled Advanced Demo Application show list of devices and my PB app no?

If your suggestion is true and correct, how I can recompile or use 32-bit VSTwain.dll to resolve my problem?????

Alex
Site Admin
Posts: 1730
Joined: Thu Jul 10, 2008 2:21 pm

Re: List Of Available Devices is Always 0

Post by Alex » Tue Jul 23, 2019 3:51 pm

If you have 32-bit application, it is possible that TWAIN Advanced Demo and your application use different TWAIN device managers.
Please read about available 32-bit TWAIN device managers here: https://www.vintasoft.com/docs/vstwain/ ... nager.html

Best regards, Alexander

daniele.frisenna
Posts: 8
Joined: Tue Jul 23, 2019 1:13 pm

Re: List Of Available Devices is Always 0

Post by daniele.frisenna » Tue Jul 23, 2019 4:42 pm

I have check on my PC and in my production test PC, the availability of device manager (1.x and 2.x) writing in Power Builder the same code show in this example: https://www.vintasoft.com/docs/vstwain/ ... nager.html

I reached the same result as before... No any available device found (DeviceManager_DeviceCount = 0)
Help !!!

Alex
Site Admin
Posts: 1730
Joined: Thu Jul 10, 2008 2:21 pm

Re: List Of Available Devices is Always 0

Post by Alex » Tue Jul 23, 2019 5:21 pm

Strange situation... For understanding the situation you need to trace TWAIN Advanced Demo and your application on "Production Test PC" and compare the tracing results. For example, you need to compare values of "DeviceManager_DllPath", "DeviceManager_IsAvailable", "DeviceManager_IsTwain2Compatible" properties during tracing. Can you do this?

Best regards, Alexander

daniele.frisenna
Posts: 8
Joined: Tue Jul 23, 2019 1:13 pm

Re: List Of Available Devices is Always 0

Post by daniele.frisenna » Tue Jul 23, 2019 6:16 pm

-------------------------------------------------------------------------------------------------------
Tracing result for: TWAIN Advanced Demo and Application on "Production Test PC"
-------------------------------------------------------------------------------------------------------
### TWAIN Advanced Demo ###
DeviceManager_DllPath: C:\WINDOWS\SysWOW64\TWAINDSM.DLL
DeviceManager_IsAvailable: true
DeviceManager_IsTwain2Compatible: true

### Power Builder Application on "Production Test PC" ###
DeviceManager_DllPath: C:\WINDOWS\SysWOW64\TWAINDSM.DLL
DeviceManager_IsAvailable: True
DeviceManager_IsTwain2Compatible: True

After application load: C:\Windows\SysWOW64\TWAINDSM.dll (Device Manager is correctly open), DSM (TWAINDSM.DLL) must looks for data sources in C:\Windows\twain_32 or C:\Windows\twain_64 (depending of OS Architecture) and walks the twain_[32|64] directory to LoadLibrary for each .ds file it finds, then uses GetProcAddress to locate the DS_Entry function.
This operation are different for my application:
- TWAIN Advanced Demo: write all needs files in: C:\windows\twain_32 correctly !!!
- Power Builder Application on "Production Test PC" : try to write all needs files in: C:\Users\{current user}\WINDOWS\twain_32 with failure !!!

Where is the problem and how to correct this?
Best regards, Daniele

Alex
Site Admin
Posts: 1730
Joined: Thu Jul 10, 2008 2:21 pm

Re: List Of Available Devices is Always 0

Post by Alex » Wed Jul 24, 2019 8:25 am

Hello Daniele,
This operation are different for my application:
- TWAIN Advanced Demo: write all needs files in: C:\windows\twain_32 correctly !!!
- Power Builder Application on "Production Test PC" : try to write all needs files in: C:\Users\{current user}\WINDOWS\twain_32 with failure !!!
You are writing that TWAINDSM.DLL searches TWAIN drives in different locations: in "C:\windows\twain_32" folder and this is correct and in "C:\Users\{current user}\WINDOWS\twain_32" that is not correct. Where did you get this information? Have you analyzed TWAIN log-file?

VintaSoft Twain ActiveX only selects TWAIN device manager, in your situation "C:\WINDOWS\SysWOW64\TWAINDSM.DLL", and gets infromation about available TWAIN drivers from TWAIN device manager (TWAINDSM.DLL).

You have the problem with TWAIN device manager on your "Production Test PC". Try to reinstall TWAINDSM.DLL and let me know result.

Information about TWAIN device managers you can read here: https://www.vintasoft.com/docs/vstwain- ... nager.html

Best regards, Alexander

daniele.frisenna
Posts: 8
Joined: Tue Jul 23, 2019 1:13 pm

Re: List Of Available Devices is Always 0

Post by daniele.frisenna » Wed Jul 24, 2019 9:58 am

Hello Alex from Venice Italy....
You are writing that TWAINDSM.DLL searches TWAIN drives in different locations: in "C:\windows\twain_32" folder and this is correct and in "C:\Users\{current user}\WINDOWS\twain_32" that is not correct. Where did you get this information? Have you analyzed TWAIN log-file?
I get Information about where TWAINDSM.DLL looks for data sources by using Process Monitor (if you want I can give to you my process Monitor print screen to analyze the tracing result).
VintaSoft Twain ActiveX only selects TWAIN device manager, in your situation "C:\WINDOWS\SysWOW64\TWAINDSM.DLL", and gets infromation about available TWAIN drivers from TWAIN device manager (TWAINDSM.DLL).
I think that you know how TWAINDSM.DLL work. This library get information about available device visible by OS and interact whit its by writing datasource files (files with .ds extension). This files must by stored in this directory: C:\windows\twain_32 (Advanced Demo APP use this directory but PB Demo APP NO!!) to make the library work properly!!!

Another thing that I forgot to say to you is that, I try to test both application (Advanced Demo App And Power Buider test App) using Terminal Server connection (from my PC open an RDP connection to remote Production test PC e test both app).

Best regards
Daniele

Alex
Site Admin
Posts: 1730
Joined: Thu Jul 10, 2008 2:21 pm

Re: List Of Available Devices is Always 0

Post by Alex » Wed Jul 24, 2019 10:38 am

I think that you know how TWAINDSM.DLL work. This library get information about available device visible by OS and interact whit its by writing datasource files (files with .ds extension).
TWAINDSM.DLL does not write files to "C:\windows\twain_32" folder. "C:\windows\twain_32" folder contains 32-bit TWAIN drivers installed in system. File with extension ".DS" is TWAIN driver. TWAIN driver is installed in the system when you install scanner drivers to computer.
TWAINDSM.DLL searches all available TWAIN drivers ("*.DS" files) in "C:\windows\twain_32" folder and tries to use them.

Another thing that I forgot to say to you is that, I try to test both application (Advanced Demo App And Power Buider test App) using Terminal Server connection (from my PC open an RDP connection to remote Production test PC e test both app).
This is important thing. I think you have the problem because remote terminal substitutes the "user’s" Windows directory for your application.
Please read about such problem here: http://support.lexmark.com/index?pmv=pr ... &id=SO4683
Disable the "user’s" Windows directory substitution for your application and let me know result.

Best regards, Alexander

Post Reply