Page 1 of 1

Troubleshooting TWAIN with Citrix

Posted: Thu May 22, 2008 4:55 am
by majicsoft
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

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 11:18 am
by Loïc
Hi,

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

Loïc

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 1:48 pm
by majicsoft
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

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 2:08 pm
by Loïc
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

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 2:49 pm
by majicsoft
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.

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 2:50 pm
by Loïc
Hi,

it is not the lastest.

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

Loïc

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 3:04 pm
by majicsoft
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.

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 3:11 pm
by majicsoft
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

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 3:13 pm
by Loïc
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

Re: SelectImageSource on Citrix

Posted: Thu May 22, 2008 3:14 pm
by Loïc
Check this link too: [Troubleshooting TWAIN with Citrix...] http://support.citrix.com/article/CTX107411

Re: Troubleshooting TWAIN with Citrix

Posted: Fri May 23, 2008 6:32 am
by majicsoft
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