connection error, not found device present

Last post 04-30-2008 16:54 by Neil. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-30-2008 16:19

    connection error, not found device present

    Hello,  when i try to connect my application,  not foud a device,   my code is :

     

     Dim
    rapiConn As New RAPI

    rapiConn.Connect()

    If rapiConn.Connected Then

    MessageBox.Show("conectado", "conectado")

    Else

    MessageBox.Show("desconectado", "desconectado")

    End If

    Dim remoteFile As String

    Dim remotePath As String

    Dim localFile As String

    Dim localPath As String

    Dim archivo As String

    remoteFile = "\My Documents\prueba.txt"

    localPath = "c:\"

    archivo = "prueba.txt"

    localFile = localPath & archivo

    remotePath = "\My Documents\"

    Try

    Do While rapiConn.DevicePresent = False

    MsgBox("Error connecting, please make sure your device is connected", MsgBoxStyle.Critical, "Device Not Found")

    Loop

    If rapiConn.DevicePresent Then

    If rapiConn.DeviceFileExists(remotePath) Then

    rapiConn.DeleteDeviceFile(remoteFile)

    rapiConn.CopyFileToDevice(localFile, remoteFile)

    ElseIf rapiConn.DeviceFileExists(remotePath) = False Then

    rapiConn.CreateDeviceDirectory(remotePath)

    rapiConn.CopyFileToDevice(localFile, remoteFile)

    Dim size As Integer

    Do While rapiConn.Connected

    size = CInt(rapiConn.GetDeviceFileSize(remoteFile))

    'ProgressBar1.Value = size

    Loop

    End If

    End If

    Catch ex As Exception

    MsgBox("The following error occurred while trying to connect to your device: " & ex.Message, MsgBoxStyle.Critical, "Connection Error")

    Exit Sub

    Finally

    rapiConn.Disconnect()

    MsgBox("File copied successfully, please wait for data import.", MsgBoxStyle.Information, "Copy Status")

    'importFile(remoteFile)

    End Try

     

     When debugg,  in line  :  Do While rapiConn.DevicePresent = False   always  is false,    but its recogniza that is conneted.

     

    help me, please.

  • 04-30-2008 16:45 In reply to

    • Neil
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-30-2007
    • North Wales
    • Posts 1,136

    Re: connection error, not found device present

    Long code blocks generally do not provide any value, so please think twice before posting them in the future. 

    Are you using the very last code from our Subversion server?

  • 04-30-2008 16:52 In reply to

    Re: connection error, not found device present

    yeah,  im download the code from  :

    tags/2.9/source

     is that correct ?

  • 04-30-2008 16:54 In reply to

    • Neil
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-30-2007
    • North Wales
    • Posts 1,136

    Re: connection error, not found device present

    No, it is not correct. The latest is allows in trunk. 

Page 1 of 1 (4 items)