LEADTOOLS Support
General
General Questions
How to Catch Twain Exceptions and Display my own User Defined Error Messages
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, June 19, 2007 3:59:45 AM(UTC)
Groups: Registered
Posts: 13
Hi,
Subject: How to Catch Twain Exceptions and Display my own User Defined Error Messages
I am working with LeadTools 15.0 SDK. For Example i want to catch PaperJam Exception and diplay ny own message like:
try
{
_twainsession.Acquire(TwainUserInterfaceFlags.None);
}
catch(TwainException ex)
{
If (ex.code= =TwainExceptionCode.PaperJam) Message.show("Paper Jam");
}
But the _twainsession.Acquire method displays its own message as shown in the attachment. The control doesm't pass to the next code line till I click Cancel. After Clicking the canecl button it displayes one more Error Message "DS or DSM reported error, app shouldn't (no need for your app to report error). Why is this so, please help me in resolving this issue.
Regards
Sridhar
subbu attached the following image(s):
#2
Posted
:
Tuesday, June 19, 2007 11:21:23 PM(UTC)
Groups: Registered
Posts: 13
Hi,
Subject: How to Catch Twain Exceptions and Display my own User Defined Error Messages
I am working with LeadTools 15.0 SDK. For Example i want to catch PaperJam Exception and diplay ny own message like:
try
{
_twainsession.Acquire(TwainUserInterfaceFlags.None);
}
catch(TwainException ex)
{
If (ex.code= =TwainExceptionCode.PaperJam) Message.show("Paper Jam");
}
But the _twainsession.Acquire method displays its own message as shown in the attachment. The control doesm't pass to the next code line till I click Cancel. After Clicking the canecl button it displayes one more Error Message "DS or DSM reported error, app shouldn't (no need for your app to report error). Why is this so, please help me in resolving this issue.
Regards
Sridhar
subbu attached the following image(s):
#3
Posted
:
Wednesday, June 20, 2007 5:22:15 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
Unfortunately, you cannot catch this error because it is being reported and displayed by the TWAIN driver. TWAIN works like a black box. With LEADTOOLS you can get and set capabilities and properties before you scan, but once you call Acquire to scan, all control is given to the scanner and unfortunately this is one thing you can't control.
#4
Posted
:
Wednesday, June 20, 2007 5:49:57 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Sridhar,
In addition to what my colleague Greg said, this message box is popped
by the Twain driver itself, not by LEADTOOLS. I have seen a similar error
message in user's guide of a Fujitsu scanner.
There is no function in the Twain standard to turn off error
messages related to the device if they are produced by the Twain driver itself.
Try to contact the vendors of your scanner to see if they
have a way of suppressing error messages.
LEADTOOLS Support
General
General Questions
How to Catch Twain Exceptions and Display my own User Defined Error Messages
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.