Wia 2.0 not initiating dialog to get the camera ID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jedrious
    New Member
    • Jun 2007
    • 1

    Wia 2.0 not initiating dialog to get the camera ID

    I'm trying to make a button that chooses a camera and then makes that camera take a picture, when running it in debug I get Exception from HRESULT: 0x80210015 with the bolded line highlighted

    I'm using Visual Studio 2005 on Vista Home Premium and Visual Basic





    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

    Dim righteyeimage As PictureBox = Nothing

    Dim settings As Object = Nothing

    Dim class1 As CommonDialogCla ss = New CommonDialogCla ss

    Dim d As Device = class1.ShowSele ctDevice(WiaDev iceType.CameraD eviceType, True, False)

    If (Not (d) Is Nothing) Then

    settings.Device ID = d.DeviceID

    settings.Save()

    End If

    Dim manager As DeviceManager = New DeviceManagerCl ass

    Dim b As Device = Nothing

    For Each info As DeviceInfo In manager.DeviceI nfos

    If (info.DeviceID = settings.Device ID) Then

    b = info.Connect

    Exit For

    End If

    Next

    settings.Execut eCommand(Comman dID.wiaCommandT akePicture)

    righteyeimage = settings.lastpi cturetaken

    PictureBox1 = righteyeimage

    End Sub
Working...