This project has moved. For the latest updates, please go here.

Sending DG_CONTROL message to Scanner

Jun 27, 2016 at 10:51 PM
I'd like to send MSG_ENDXFER to the scanner via a DG_CONTROL message. It's part of the Twain spec. Is this possible with SaraffTwain library? If so can you supply some sample code on how to achive this. I want to cancel the Acquire command.

From Twain Spec:
MSG_ENDXFER Application acknowledges or requests the end of data
Jun 28, 2016 at 8:17 AM
Hello, javamike.
Try set a true value to a Cancel property of event args (for the XferDone, EndXfer, SetupMemXfer, MemXfer, SetupFileXfer, FileXfer events). You mast download latest source code.
Change set number f637719d86e1.
private void _twain32_EndXfer(object sender, Twain32.EndXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
Marked as answer by SARAFF on 7/1/2016 at 10:33 AM
Jul 5, 2016 at 11:54 PM
Edited Jul 18, 2016 at 11:23 PM
Hello Saraff,

I implemented the above change but the scanner did not stop scanning pages. I'm using Outproc Twain Sample, Saraff.Twain.Aux_x86.exe, and compiled in the update, if that matters. Any thoughts on why the scanner is not stopping?

Jul 6, 2016 at 4:51 AM
Hello, javamike.
This is related with a Saraff.Twain.Aux ( I already made the necessary changes, but did not publish them. I can send them to you in the form of source code.
Jul 6, 2016 at 4:36 PM
Edited Jul 18, 2016 at 11:23 PM
Saraff, can you send the source code to xxxxxxx.

Thank you.
Jul 14, 2016 at 12:34 AM
Edited Jul 14, 2016 at 12:41 AM
Hello Saraff, I received the email with the new Saraff.Twain.Aux sourcecode however it refers to
Saraff.Twain\Saraff.Twain.Aux\Twain32RealProxy.cs(168,55,168,82): error CS0426: The type name 'SerializableCancelEventArgs' does not exist in the type 'Saraff.Twain.Twain32'

SerializableCancelEventArgs is not defined in the forked Saraff.Twain library. Can you send the update to that library as well? When is the next release scheduled?
Jul 14, 2016 at 8:40 AM
Hello, javamike
You had to download the latest version of the source code..
Next release is scheduled for early August.
Jul 18, 2016 at 11:22 PM
Hello Saraff, I was able to verify the changes. Looking forward to the release. -Mike