Accesing a scanner using WIA

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello.
I want to access a scanner using WIA. I have a little application that consists of a form with a button. Code:
class Scanner<br/>
{<br/>
Device oDevice;<br/>
Item oItem;<br/>
CommonDialogClass dlg;<br/>
<br/>
public Scanner()<br/>
{<br/>
dlg = new CommonDialogClass();<br/>
oDevice = dlg.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);<br/>
<br/>
}<br/>
public void Scann()<br/>
{<br/>
dlg.ShowAcquisitionWizard(oDevice);<br/>
}<br/>
}
The onClick event of the button has the following:
Scanner oScanner = new Scanner();<br/>
oScanner.Scann();
At first I was getting a COMexception was unhandled ExcepciÃn HRESULT: 0x80210015, which according to some googling, is because I didnt have any device connected to the PC. I connected a USB scanner (Visioneer 4400 USB) and everything worked fine
(a window popped telling me to choose te device etc).
The thing is... I want to do the same with a Fujitsu ScanSnap s1500... but after I connect it and click the button I get the exception I mentioned above. So, is that particular scanner model not compatible with WIA? Anyone knows how to make a little C# app
to access that particular scanner?
Thanks in advance

View the full article
 
Back
Top