StackOverFlow Exception

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

StackOverFlow Exception

Post by BillG » Wed Oct 15, 2008 7:21 pm

private void ScanButton_Click(object sender, EventArgs e)
{
try
{
vsTwain1.StartDevice();
vsTwain1.ShowUI = false;
if (vsTwain1.SelectSource())
{
vsTwain1.DisableAfterAcquire = true;
vsTwain1.MaxImages = 1;
vsTwain1.AutoCleanBuffer = true;
vsTwain1.OpenDataSource();
if (vsTwain1.FeederPresent)
{
vsTwain1.FeederEnabled = true;
vsTwain1.AutoFeed = true;
vsTwain1.XferCount = -1;
if (vsTwain1.FeederLoaded)
{
while (vsTwain1.AcquireModal())
{
try
{
vsTwain1.SaveImage(0, "c:\test.tiff");
}
catch (TwainException ex)
{
MessageBox.Show(ex.Message);
}
}
vsTwain1.StopDevice();
}
MessageBox.Show("Scan completed.");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

I get a stackoverflow exception on the AcquireModal() function call. The scanning progress indicatior starts moving and then I get the exception.

Bill

BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Re: StackOverFlow Exception

Post by BillG » Wed Oct 15, 2008 7:56 pm

Forget it. I got it to work. I was checking the HP forums and found the answer from someone on there. You have to set ShowIndicators to false before caling Acquire or AcquireModal(). It is a problem with the twain drivers from HP.

Alex
Site Admin
Posts: 1536
Joined: Thu Jul 10, 2008 2:21 pm

Re: StackOverFlow Exception

Post by Alex » Thu Oct 16, 2008 8:29 am

Hello Bill,

Thank you for the information.

We can try to fix this problem if you send us a log-file generated by the library. Please read how to generate log-file in the documentation and send it to us. Also you can share your experience about HP scanners in the "Hardware and Vendors Discussions" forum.

Best regards, Alexangr

Post Reply