Twain - Wia distintion
Twain - Wia distintion
Hello,
I'm currently evaluating your library for image aquisition with TWAIN scanners.
For this purpose I have a Canon test device that is accesable throught both, WIA and TWAIN.
If I call "TwainSelectSource(windowHandle)" I get a list with two entries:
1# devicename
2# WIA - WIA devicename
But after calling "TwainGetSourceCount()" I loop to get all device names with "TwainGetSourceName()" and both results have now the exact same name "devicename".
How can I decide which one is the TWAIN device and which is the wrapped WIA device?
Regards,
Benjamin
I'm currently evaluating your library for image aquisition with TWAIN scanners.
For this purpose I have a Canon test device that is accesable throught both, WIA and TWAIN.
If I call "TwainSelectSource(windowHandle)" I get a list with two entries:
1# devicename
2# WIA - WIA devicename
But after calling "TwainGetSourceCount()" I loop to get all device names with "TwainGetSourceName()" and both results have now the exact same name "devicename".
How can I decide which one is the TWAIN device and which is the wrapped WIA device?
Regards,
Benjamin
Re: Twain - Wia distintion
Hi Benjamin,
Let me know if you need more information.
Loïc
It's easy, just check for the 4 first chars. If it is "WIA ", this is the WIA wrapper of your driver.How can I decide which one is the TWAIN device and which is the wrapped WIA device?
Let me know if you need more information.
Loïc
Re: Twain - Wia distintion
yes, more information would be nice.benjamin wrote:and both results have now the exact same name "devicename".
Re: Twain - Wia distintion
Hi,
As I know you should have the exact same names.
Could you provide a print-screen of the dialog raised by TwainSelectSource & the one raised by the following code:
Loïc
As I know you should have the exact same names.
Could you provide a print-screen of the dialog raised by TwainSelectSource & the one raised by the following code:
Code: Select all
Dim Dev As String = ""
For i As Integer = 1 To Imaging1.TwainGetSourceCount(Nothing)
If i > 1 Then Dev += vbCrLf
Dev += Imaging1.TwainGetSourceName(Nothing, i)
Next
MsgBox(Dev)
Re: Twain - Wia distintion
I changed your code to this to some language incompatibilities
string devices = string.Empty;
for (int i = 0; i < TwainManager.TwainGetSourceCount(); i++)
{
devices += TwainManager.TwainGetSourceName(i);
if (i == 0)
devices += ",\n";
}
MessageBox.Show(devices);
I attached the screenshots. MsgBox.jpg is the one produced by the code above, SelectDialog.jpg the one by "TwainSelectSource(handle)".
Regards,
Benjamin
string devices = string.Empty;
for (int i = 0; i < TwainManager.TwainGetSourceCount(); i++)
{
devices += TwainManager.TwainGetSourceName(i);
if (i == 0)
devices += ",\n";
}
MessageBox.Show(devices);
I attached the screenshots. MsgBox.jpg is the one produced by the code above, SelectDialog.jpg the one by "TwainSelectSource(handle)".
Regards,
Benjamin
- Attachments
-
- MsgBox.jpg (8.35 KiB) Viewed 7728 times
-
- SelectDialog.jpg (14.43 KiB) Viewed 7728 times
Re: Twain - Wia distintion
damn I never seen that
Seems there is a char 0 or a line separator in your device name...
I will try to get your TWAIN driver to investigate this problem...
Kind regards,
Loïc
Seems there is a char 0 or a line separator in your device name...
I will try to get your TWAIN driver to investigate this problem...
Kind regards,
Loïc
Re: Twain - Wia distintion
Thanks for investigating this issue. If you need any further information or testing on my side then let me know.
Regards,
Benjamin
Regards,
Benjamin
Re: Twain - Wia distintion
Hi,
Unfortunately I am locked.
I have been able to download the driver but not able to install it because the installer requires the device...
Maybe generating a log can helps: Add TwainLogStart(logpath) in the start of your code snippet. Then report the content of the log here.
Kind regards,
Loïc
Unfortunately I am locked.
I have been able to download the driver but not able to install it because the installer requires the device...
Maybe generating a log can helps: Add TwainLogStart(logpath) in the start of your code snippet. Then report the content of the log here.
Kind regards,
Loïc
Re: Twain - Wia distintion
I used DSMident method in twain_32.dll directly to access the information and in the TwIdentity record in ProductName I get the correct value: "WIA-WIA Canon MX870 ser".
The ProductFamily field would help, too. It reads "Twain Data Source On WIA" for the wrapped WIA device and "TWAIN Scanners" for the native Twain device. I don't know if this is reliable for every device but it might be another method to distinguish Twain from WIA. Is it somehow possible to read this field with your library?
Here is the log for the code snippet:
Regards,
Benjamin
The ProductFamily field would help, too. It reads "Twain Data Source On WIA" for the wrapped WIA device and "TWAIN Scanners" for the native Twain device. I don't know if this is reliable for every device but it might be another method to distinguish Twain from WIA. Is it somehow possible to read this field with your library?
Here is the log for the code snippet:
Code: Select all
#GdTwain Log Start. Version: 645
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
GetValidHwnd: Creating Proxy window.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
Start: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
DSM library loaded: C:\Windows\TWAIN_32.DLL
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
Entry point of the DSM found.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
End: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: Start Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: End Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: Start Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: End Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: Start Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
GDTWAIN_Mgr: End Getting DAT_STATUS
RC: TWRC_ENDOFLIST
CC: TWCC_SUCCESS
State: 3
-------------------
Regards,
Benjamin
Re: Twain - Wia distintion
Hi,
Unfortunately we miss thin function. We will add it in 7.3.
Kind regards,
Loïc
Unfortunately we miss thin function. We will add it in 7.3.
Kind regards,
Loïc
Re: Twain - Wia distintion
Instead of iterating from 0 try starting at 1 and changing to <=. I ran into a similar issue with GdPicture.NET Ultimate v6.string devices = string.Empty;
for (int i = 0; i < TwainManager.TwainGetSourceCount(); i++)
{
devices += TwainManager.TwainGetSourceName(i);
if (i == 0)
devices += ",\n";
}
MessageBox.Show(devices);
Who is online
Users browsing this forum: No registered users and 1 guest