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

SelectSource throw exception when I click on cancel (AnyCPU using on 64bit OS)

Jan 11, 2016 at 7:42 AM
Hi Saraff
on latest version of SaraffTwain I have an exception in SelectSource if I click on Cancel button.
It returns "it worked" but in x86 mode it doesn't happens.
What's wrong in my implementation ?

Thank you
Domenico
Coordinator
Jan 11, 2016 at 5:38 PM
Hello, dbarile.
Try use follow:
try {
    this._twain.CloseDataSource();
    this._twain.SelectSource();
} catch(TwainException ex) {
    if(ex.ReturnCode!=TwRC.Cancel) {
        MessageBox.Show(ex.Message,"SAMPLE",MessageBoxButtons.OK,MessageBoxIcon.Error);
    }
} catch(Exception ex) {
    MessageBox.Show(ex.Message,"SAMPLE",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
Marked as answer by SARAFF on 1/17/2016 at 12:44 AM