Several Connect/Disconnect results in device not connected error message

Nov 24, 2015 at 1:16 PM
Hi,

I have an application which copy file to/from a WinCE 6.0 device. I am using latest stable RAPI2.dll in my VB.NET Visual Studio 2008 environment. I receive error message from DLL saying cannot perform this operation on a disconnected device even if Windows Mobile Center shows device as connected, even if below code enables button to copy file from device.

Any help is appreciated.

Sample code which is checking if device is connected is as follows:
Imports System.Devices

Public Class Form1
    Dim ElTerminali As RemoteDevice = Nothing
    Dim Manager As New System.Devices.RemoteDeviceManager
.
.
.
.
    Private Sub tmrCheck_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrCheck.Tick
        ' İşlemler uzarsa eğer tekrar çalışma zamanı gelmesin. Durdur
        tmrCheck.Enabled = False

        ' Bağlı mı kontrol et
        ElTerminali = Manager.Devices.FirstConnectedDevice

        If ElTerminali Is Nothing Then
            ' Ekranda bilgileri güncelle
            lblStatus.BackColor = Color.Yellow
            lblStatus.Text = "Durum: Bağlantı bekleniyor..."
            lblStatus.Font = New Font(lblStatus.Font, FontStyle.Regular)
            btnOkumalariAl.Enabled = False
            btnDosyaTerminale.Enabled = False
            DBYokOkumalar = False
            DBYokSabitler = False
            DeviceId = Nothing
        Else          
            ' Ekranda bilgileri güncelle
            lblStatus.BackColor = Color.GreenYellow
            lblStatus.Text = "Bağlanıldı: " & ElTerminali.Name
            lblStatus.Font = New Font(lblStatus.Font, FontStyle.Bold)
            btnDosyaTerminale.Enabled = True
            btnOkumalariAl.Enabled = True
        End If

        ' Bir sonraki kontrol için tekrar çalıştır
        tmrCheck.Enabled = True
    End Sub
.
.
.
.
End Class