Troubleshooting TWAIN with Citrix

Discussions about image processing and document imaging.
Post Reply
majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Troubleshooting TWAIN with Citrix

Post by majicsoft » Thu May 22, 2008 4:55 am

Hi,

I have been trialling GdPicture Pro for a project that will be running on a Citrix Presentation Server. I am developing the software using Visual DataFlex v11.0 on Windows XP Pro. The software works correctly on my development box. However, when I installed it and ran it on the Citrix server, I got the following error:
GDTwain
SelectImageSource: Unable to open Source Manager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
The code that produces this error is:

Get ApplicationWindowHandle To hWnd
Get ComTwainSelectSource hWnd To iResult


I have also tried it with the HTML examples and, this actually did work when remotely accessing the Citrix box. This would seem to indicate that the Citrix box is correctly configured for remote imaging. I can't see that I am doing anything differently in my application.

Can anybody tell me what I am doing wrong?

Thanks
Anthony

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SelectImageSource on Citrix

Post by Loïc » Thu May 22, 2008 11:18 am

Hi,

What is the returned value of the TwainIsAvailable() method ?

Loïc

majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Re: SelectImageSource on Citrix

Post by majicsoft » Thu May 22, 2008 1:48 pm

Loïc wrote:Hi,

What is the returned value of the TwainIsAvailable() method ?

Loïc
Hi Loïc,

Zero, zip, zilch (0).

Does that help?

Incidentally, I get the same error message as above when I run the Delphi & VB Twain examples. So, I am guessing that the problem is not with my app. If that is the case, then it is either the Citrix server configuration or a bug in the control on a Citrix platform. Of course, it could also be an incompatibility within Visual DataFlex that is also shared with Delphi & VB ...

Thanks,
Anthony

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SelectImageSource on Citrix

Post by Loïc » Thu May 22, 2008 2:08 pm

Hum.. This means that TWAIN is not available into your citrix computer.

Please:
- Download the last edition: https://www.gdpicture.com
- Add this line as the first line of your code: Imaging1.TwainLogStart("c:\twainlog.txt")
- Add this line as the last of your code: Imaging1.TwainLogStop()

Now, give me the content of the log file to see what is wrong.


Best regards,

Loïc Carrère

majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Re: SelectImageSource on Citrix

Post by majicsoft » Thu May 22, 2008 2:49 pm

Hi Loïc,

I only downloaded the eval a day or so back, so am I right in assuming that it is the latest?

I have added the logging in and, this is what I got ...

Thanks, Anthony

#GdTwain Log Start. Version: 423

RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
Start: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
End: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
SelectImageSource: Unable to open Source Manager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
#GdTwain Log Stop.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SelectImageSource on Citrix

Post by Loïc » Thu May 22, 2008 2:50 pm

Hi,

it is not the lastest.

I need the log of the 5.4.4 edition wich are available since Today.

Loïc

majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Re: SelectImageSource on Citrix

Post by majicsoft » Thu May 22, 2008 3:04 pm

Hi Loïc,

Ok, here it is ...

Thanks,
Anthony

#GdTwain Log Start. Version: 424

RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
DSM library can not be loaded: C:\Documents and Settings\Administrator\WINDOWS\TWAIN_32.DLL
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
Start: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
DSM library can not be loaded: C:\Documents and Settings\Administrator\WINDOWS\TWAIN_32.DLL
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
End: OpenSourceManager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
SelectImageSource: Unable to open Source Manager.
RC: TWRC_SUCCESS
CC: TWCC_SUCCESS
State: 1
-------------------
#GdTwain Log Stop.

majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Re: SelectImageSource on Citrix

Post by majicsoft » Thu May 22, 2008 3:11 pm

Hi Loïc,

Looks like the DLL needs to be copied into the current user's Windows folder. I have done that and, lo & behold, the scanner is being detected.

Now, I have a new problem ...

But I will take a closer look at that tomorrow.

Thanks for all of your help.
Anthony

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SelectImageSource on Citrix

Post by Loïc » Thu May 22, 2008 3:13 pm

Hi,

Ok I understand.


gdtwain.dll needs to be linked to the TWAIN_32.DLL library wich is include into the Windows directory.

To retrieve the Window directory gdtwain use the GetWindowsDirectory() function: http://msdn.microsoft.com/en-us/library ... S.85).aspx

However, this function returns C:\Documents and Settings\Administrator\WINDOWS\ on your citrix server, instead C:\WINDOWS\. Maybe it is a Citrix behaviour ?

If this folder really exists, you can try to copy the TWAIN_32.DLL on it.

Best regards,

Loïc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SelectImageSource on Citrix

Post by Loïc » Thu May 22, 2008 3:14 pm

Check this link too: [Troubleshooting TWAIN with Citrix...] http://support.citrix.com/article/CTX107411

majicsoft
Posts: 7
Joined: Thu May 22, 2008 4:35 am

Re: Troubleshooting TWAIN with Citrix

Post by majicsoft » Fri May 23, 2008 6:32 am

Hi Loïc,

Thanks for all of your help. It seems to be working correctly now that I have put the DLL in each user's home Windows folder.

The only real issue that I have at the moment is one of performance. It is very slow returning the scanned image to the server. Unfortunately, that is probably not something you can help me with. I am probably going to have to see about getting a faster link.

Thanks again,
Anthony

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest