views:

19

answers:

1

I'm using a slightly modified version of Twain Dot Net in my scanning application. The problem is, when the user cancels scanning using a button on the scanner (or if paper jams), TWAIN should show an error message and return with some failure code.

But instead, what happens is that the call to DG_IMAGE / DAT_IMAGENATIVEXFER / MSG_GET returns correctly with TWRC_XFERDONE, but the call to DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER right after that never returns. What am I doing wrong?

The application is written using WPF, TWAIN's messages are sent to a message-only window running on its own thread. The scanner is Panasonic KV-S4065C.

A: 

I have fixed it. I'm not exactly sure what's going on, but running all TWAIN methods on the same message loop TWAIN is set up to use did it. That also meant splitting the image transfer loop – after one iteration finishes, it enqueues itself on the message loop.

svick