Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, May 22, 2006 4:56:05 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


I am using Delphi 7, Leadtools 14.5 Evaluation and Canon DR-9080C scanner. When I try to set the CAP_AUTOSCAN capability, I keep getting this error message:

Error code: -566
SetCapability: Required capability not supported.

I am sure that the scanner supports the capability, since a can set the capability with the Twacker utility (Twack_32.exe).

Here is the code I am using:

procedure TFormMain.Button3Click(Sender: TObject);
var
   twCap: TW_CAPABILITY;
begin
  twCap.Cap:= CAP_AUTOSCAN;
  twCap.ConType:= TWON_ONEVALUE;
  LEADTwain1.CreateNumericContainerOneValue(@twCap, TWAINNUMERICTYPE_TW_BOOL, Cardinal(True));
  LEADTwain1.SetCapability(@twCap, LTWAIN_CAPABILITY_SET);
  LEADTwain1.FreeContainer(@twCap);
end;

What am I doing wrong?

Thanks.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, May 24, 2006 3:26:13 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

If you check the VCL Twain Delphi v7.0 demo, can you see the CAP_AUTOSCAN capability in the supported capabilities list?
You can check this as follows:
- Open the VCL Twain Delphi v7.0 demo.
- Select the "Template"\"Show supported capabilities" menu (the supported capabilities dialog appears).
- Now check the supported capabilities list.

Please check the list and let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Wednesday, May 24, 2006 4:20:48 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


Yes, I can see CAP_AUTOSCAN in the supported capabilities list in the demo.
 
#4 Posted : Wednesday, May 24, 2006 11:54:01 PM(UTC)
scrap2000

Groups: Registered
Posts: 15


I tried setting other capabilities too, for example CAP_AUTOFEED, CAP_AUTOSCAN, CAP_DUPLEX, CAP_DUPLEXENABLED, and I almost always get the same error (-566). All these capabilities are in the list of supported capabilities. I said almost always, because sometimes I get the error -569: Twain source state is not valid for the required operation.
I don't understand what "state". Where do I set the "state"?
I'm confused. Help would be appreciated.
Thanks.
 
#5 Posted : Thursday, May 25, 2006 10:45:32 AM(UTC)
jljamison

Groups: Registered
Posts: 19


Yeah I'm getting the same issue with my Canon LiDE 35 scanner.  The call to GetCapability is returning -569

Where did you find the translation of that error code? I don't have it in my docs

-John Jamison
 
#6 Posted : Friday, May 26, 2006 3:18:56 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


 jljamison wrote:Where did you find the translation of that error code?

It's in the error message.
 
#7 Posted : Sunday, May 28, 2006 6:15:16 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Can you please send me a small sample project (not your full application) that shows the -566 and the 569 errors? I need to investigate more about this issue.

About the error documentation, you can find the error documentation in the Main VCL documentation under the "Return Codes" topic.

Please let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#8 Posted : Monday, May 29, 2006 1:28:14 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


Here is a sample Delphi 7 project.
File Attachment(s):
ScanTest.zip (9kb) downloaded 50 time(s).
 
#9 Posted : Wednesday, May 31, 2006 6:04:11 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

I am having some problems in running the project. Currently I am working on this issue. I will update you with the testing status very soon.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#10 Posted : Thursday, June 1, 2006 5:58:00 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

I checked your code and modified it. Can you please retry the same issue using the following code?
+-----------------------------+
procedure TForm1.Button1Click(Sender: TObject);
Var
nRet: L_INT;
twCap: TW_CAPABILITY;
Begin
if Not bTwainInitailized then
begin
LEADTwain1.InitSession(Handle);
bTwainInitailized := True;
end;
// Show the Twain Select Source UI
nRet := LEADTwain1.SelectSource();
If(nRet <> SUCCESS) then
Begin
ShowMessage('Error occurred while selecting the source.');
Exit;
End;
twCap.Cap:= CAP_AUTOSCAN;
twCap.ConType:= TWON_ONEVALUE;
LEADTwain1.CreateNumericContainerOneValue(@twCap, TWAINNUMERICTYPE_TW_BOOL, 1);
nRet := LEADTwain1.SetCapability(@twCap, LTWAIN_CAPABILITY_SET);
ShowMessage('SetCapability retuned ' + IntToStr(nRet));
LEADTwain1.FreeContainer(@twCap);

ShowMessage(IntToStr(nRet));
LEADTwain1.EnableAcquirePageEvent:= True;
nRet := LEADTwain1.Acquire(LTWAIN_SHOW_USER_INTERFACE);
If nRet = SUCCESS Then
ShowMessage('The image acquisition process completed.')
Else
ShowMessage(IntToStr(nRet) + ' error was returned');
LEADTwain1.EndSession;
bTwainInitailized := False;
ShowMessage('Error occurred while selecting the source.');
end;
+-----------------------------+

Important note: don't init more than once.

Please let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#11 Posted : Thursday, June 1, 2006 11:26:27 PM(UTC)
scrap2000

Groups: Registered
Posts: 15


Hello,
Your code doesn't work either. It returns Error code: -566 SetCapability: Required capability not supported.
It happens on this line:
nRet := LEADTwain1.SetCapability(@twCap, LTWAIN_CAPABILITY_SET);

And also another thing is that I would like to set the source programmatically, without showing the user interface. So I tried to replace
nRet := LEADTwain1.SelectSource();
with
LEADTwain1.AcquireSourceName := 'Canon DR-9080C TWAIN';
but in this case the SetCapability command returns the
error -569: Twain source state is not valid for the required operation.
 
#12 Posted : Monday, June 5, 2006 2:38:31 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

If you try the same issue using a different scanner, do you face the same issue?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#13 Posted : Monday, June 5, 2006 5:35:14 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


Yes, I tried a different scanner (Innotec) and it gave me the same error.
 
#14 Posted : Tuesday, June 6, 2006 1:11:17 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

A possible cause of the problem is using an old build of our DLLs. Please download and apply the latest patches for your LEADTOOLS product. You can download the latest patches from our support site http://support.leadtools.com as follows:
1. You have to login our support site: http://support.leadtools.com.  
If you are not a registered user, you need to register your email, and then login the support site.
2. After login, select "My Profile" tab and click "Add product registration" link.
3. Now, in the "Add a product registration" page insert your product serial#, and register your product.
4. After login, download the latest LEADTOOLS patches from the "SDK Patches" tab.

Please let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#15 Posted : Tuesday, June 6, 2006 10:47:07 PM(UTC)
scrap2000

Groups: Registered
Posts: 15


Thanks for your advice, but I don't have the serial nubmer. I am evaluating Leadtools using Leadtools 14.5 Evaluation. Our company won't buy your product, unless I can guarantee that it does all that we need. And though Leadtools seems to be a great product with lots of great features, and I'd like to use it in our applications, we can't buy it until such basic functionality as seetting the scanner capabilities works with no problems. Do you have any other suggestions for me to try?
Thanks.
 
#16 Posted : Thursday, June 8, 2006 3:41:07 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

The evaluation setups are expected to be uploaded tonight or tomorrow.
Can you please wait until tomorrow and then download the latest evaluation setup and try with it.
You can download it directly by using the following URL:
http://www.leadtools.com/evaldownloads/v14/eval/LEADTOOLSEVAL.exe

Also, make sure to recheck this issue using the code that I sent to you.

Please let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#17 Posted : Thursday, June 8, 2006 5:23:09 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


Ok, thanks. I'll try tomorrow.
 
#18 Posted : Monday, June 12, 2006 1:58:19 AM(UTC)
scrap2000

Groups: Registered
Posts: 15


I downloaded and installed the latest  eval. version and the issue seems to be solved. I'm going to do some more testing this week, hopefully everything will be all right.

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.257 seconds.