Getting Correct TwainSourceName string using VFP

Discussions about image processing and document imaging.
Post Reply
User avatar
2basix
Posts: 7
Joined: Wed May 23, 2007 1:23 pm
Location: Netherlands
Contact:

Getting Correct TwainSourceName string using VFP

Post by 2basix » Sat May 26, 2007 1:27 pm

Hi there,

The functions provided by the GDxxx OCX are 1 character to long for
use in Visual Foxpro applications.
To get a correct String, strip 1 character at the end.

cGetSource=TwainGetSourceName(1)
cGoodVFPString=SUBSTR(cGetSource,1,LEN(cGetSource)-1)

The reason for that is that the TwainGetSourceName(x) function
returns a string with a chr(0) at the end !!! ( a string terminator in eg C++ )
You have to strip this 1 character in order to get a correct Foxpro string.

Hope this helps all you Foxpro addicts out there.

Greetings,

Leo

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

Post by Loïc » Tue May 29, 2007 10:58 am

Hi Leo. Thanks for this repport.

For the next release I will remove the end chr(0) from the returned string.


Regards,

Loïc

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests