Page 1 of 1

StackOverFlow Exception

Posted: Wed Oct 15, 2008 7:21 pm
by BillG
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

Re: StackOverFlow Exception

Posted: Wed Oct 15, 2008 7:56 pm
by BillG
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.

Re: StackOverFlow Exception

Posted: Thu Oct 16, 2008 8:29 am
by Alex
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