I am using the OpenNETCF.Desktop.Communication.DLL (version 2.9.4262.14435) to read a file from a Motorola MT2070 scanner.
I have written an application in vb.NET (Framework 4.0) that checks every 5 seconds if a file is available on the scanner.
If a file is available it is copied from the scanner to a local folder on the pc for further processing.
The program runs fine for most of the time, but occasionally i get an error like the one below, causing the program to close.
This problem occurs both with ActiveSync on Windows XP or with Windows Mobile Device Center on Windows 7.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at OpenNETCF.Desktop.Communication.RAPI.Connect(Boolean WaitForInit, Int32 TimeoutSeconds)
at Scanner_Interface.FrmMain.TimerClock_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Another issue I have is that the program sometimes freezes on the CeGetFileAttributes function in routine
After 5 to 10 minutes the program continues again, but in the meantime the endusers have already restarted the program (with Task Manager).
After restarting the program everything works fine.
public bool DeviceFileExists(string RemoteFileName)
// check for connection
uint attr = CeGetFileAttributes( RemoteFileName );
if ( attr == 0xffffffff )
Does anyone recognize these issues ?
Any help is welcome…