Scan multiple pages with WIA in C# return HRESULT E_FAIL

  • Thread starter Thread starter pol9595
  • Start date Start date
P

pol9595

Guest
Hello,



I try to scan multiple pages with WIA in C# on Windows 10 64 bit Build 17763, the first page work, but the scanner fails for second page and return an error "HRESULT E_FAIL" "System.Runtime.InteropServices.COMException (0x80004005)"



WIA.CommonDialog dialog = new WIA.CommonDialog();
Device device = dialog.ShowSelectDevice(WiaDeviceType.ScannerDeviceType, true, false);
Items items = dialog.ShowSelectItems(device);
foreach (Item item in items)
{
while (true)
{
try
{
ImageFile image = (ImageFile)dialog.ShowTransfer(item);
}
catch (COMException ce)
{
Console.WriteLine(ce);
}
}
}


I tried with some scanners HP and I have the same problem.

Thanks

Continue reading...
 
Back
Top