I have done a lot of debugging of TWAINWorkingGroupToolkit.TWAINCSToolkit::ScanCallback. No matter what I did in my custom form or using the sample applications, I always would get a SEQERR. For native image transfer, it would call into ScanCallback at these places:
ScanCallback: 006 (successful transfer of bitmap)
ScanCallback: 052 (Failed to get image info)
Looking at the TWAIN 2.4 Specification on page 3-20, the DG_IMAGE / DAT_IMAGEINFO / MSG_GET and DG_IMAGE / DAT_IMAGELAYOUT / MSG_GET should only get called in TWAIN State 6 before the image transfer. However, looking at ScanCallback, it appears that this is always attempting to happen after the image transfer, which is causing the SEQERR.
I'm not sure how long this has been an issue, but it basically causes the toolkit to not be usable at all, making C# developers use the TWAINWorkingGroup.TWAIN class. This is probably okay in the long-run for developers, but it is extremely frustrating when trying to figure out the finer parts of TWAIN and when stuff should happen.
I realized there was a bug in my code that was causing my SEQERROR. We also inded up not using the TWAINCSToolkit, but instead used the TWAIN object directly.
I have done a lot of debugging of
TWAINWorkingGroupToolkit.TWAINCSToolkit::ScanCallback
. No matter what I did in my custom form or using the sample applications, I always would get a SEQERR. For native image transfer, it would call into ScanCallback at these places:ScanCallback: 006
(successful transfer of bitmap)ScanCallback: 052
(Failed to get image info)Looking at the TWAIN 2.4 Specification on page 3-20, the
DG_IMAGE / DAT_IMAGEINFO / MSG_GET
andDG_IMAGE / DAT_IMAGELAYOUT / MSG_GET
should only get called in TWAIN State 6 before the image transfer. However, looking atScanCallback
, it appears that this is always attempting to happen after the image transfer, which is causing the SEQERR.I'm not sure how long this has been an issue, but it basically causes the toolkit to not be usable at all, making C# developers use the
TWAINWorkingGroup.TWAIN
class. This is probably okay in the long-run for developers, but it is extremely frustrating when trying to figure out the finer parts of TWAIN and when stuff should happen.