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
StackOverFlow Exception
Moderator: Alex
-
- Posts: 47
- Joined: Fri Oct 10, 2008 3:52 pm
Re: StackOverFlow Exception
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.
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: StackOverFlow Exception
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
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