1

I am struggling with WIA. I have 2 scanners connected to the same computer and I'm writing an app (VB.net) to scan from scanner 1, then scanner 2, then scanenr1 again.

WIA is happy to select scanner2 after scanner 1 but refuses to come back to scanner 1 after scanner 2. It looks like scanner 1 was "locked" ? after its first use. Is it possible to unlock/reset/disconnect a WIa device in VB so the I can come back later on scanner 1 ?

I already tried :

scanner.disconnect 
scanner.dispose
scanner.closes
scanner.disconnect()
scanner.dispose()
scanner.close()

they all generate an error message,

I also tried

scanner=nothing

at the end of the loop and

System.Runtime.InteropServices.Marshal.ReleaseComObject(scanner)

These last two do not generate any error but do not solve the problem.

I can't imagine that there would be a .connect function without its counter part to disconnect the device ! ?

Does anyone have an idea on how to unlock or disconnect a scanner with WIA in VB.net > thanks

vincent
  • 545
  • 1
  • 5
  • 8
  • Why don't you just use *two* scanner objects? – Hans Passant Dec 04 '12 at 02:27
  • i tried that solution too: using a loop to declare different objects for each scanner (scanner(1) scanner(2) etc...). WIA was happy to scan from scanner1, then scanner2 but refused to scan a second time from scanner1 again. :( – vincent Dec 04 '12 at 08:35

0 Answers0