Exception From Wia Scanner

0

I am using WIA to connect to a scanner. I enumerate the device Infos and then try connecting to the device. I keep getting the exception.

Exception from HRESULT: 0x80070021

WIA.DeviceManager manager = new WIA.DeviceManager();
WIA.Device device = null;
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
// connect to scanner
 device = info.Connect();
 break;
}

Exception message is: The process cannot access the file because another process has locked a portion of the file. (Exception from HRESULT: 0x80070021)

My Scanner machine not connected. I got error "access the file because another process has locked a portion of the file. (Exception from HRESULT: 0x80070021)"

But Individually Scan working fine. when i try to connect with coding i get error.

c#
wia
asked on Stack Overflow May 22, 2018 by Angappan.S • edited May 24, 2018 by Angappan.S

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0