WIA Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to write an application to get the images from the scanner which
is attached to the USB port. I have created the WIA.DevceManager object, but
when I try to get the count for the device to check if the scanner was
detected or not, it returns (0) devices. I can see the scanner when I user
Microsoft Office Document Scanning software which comes as part the of the
microsoft office. I need some help really urgent, please....

Here is the code that I am using:

Dim wiaManager As WIALib.SafeWiaClass = Nothing
Dim wiaDevs As WIALib.CollectionClass = Nothing
wiaManager = New WIALib.SafeWiaClass
wiaDevs = wiaManager.Devices
If IsNothing(wiaDevs) Or wiaDevs.Count = 0 Then
MessageBox.Show("No devices found!", "Scanning devices",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
Else
Dim i As Int16
For i = 0 To wiaDevs.Count - 1
Me.cmbDevices.Items.Add(wiaDevs.Item(i))
Next
End If

Iqbal
 
Hi,

Are you sure the scanners driver supports wia?

Ken
------------------
Hi,

I am trying to write an application to get the images from the scanner which
is attached to the USB port. I have created the WIA.DevceManager object, but
when I try to get the count for the device to check if the scanner was
detected or not, it returns (0) devices. I can see the scanner when I user
Microsoft Office Document Scanning software which comes as part the of the
microsoft office. I need some help really urgent, please....

Here is the code that I am using:

Dim wiaManager As WIALib.SafeWiaClass = Nothing
Dim wiaDevs As WIALib.CollectionClass = Nothing
wiaManager = New WIALib.SafeWiaClass
wiaDevs = wiaManager.Devices
If IsNothing(wiaDevs) Or wiaDevs.Count = 0 Then
MessageBox.Show("No devices found!", "Scanning devices",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
Else
Dim i As Int16
For i = 0 To wiaDevs.Count - 1
Me.cmbDevices.Items.Add(wiaDevs.Item(i))
Next
End If

Iqbal
 
I have tried using HP ScanJet also, but the same result. Is there anyway
that I look at any vb.net code to figure out that if I am missing something..
 
Back
Top