I’ve been upgrading (from 4.2 to 4.3) the “Tyrannt” sample program published under the codeshare for examples on file IO as its one of the few more complex VB examples that I’ve found to date. I intermittently (but more often than not) get these errors:
Exception System.IO.IOException - CLR_E_FILE_IO (4)
Exception System.IO.IOException - CLR_E_FILE_NOT_FOUND (4)
when loading bmp files off of an SD-Card. It fails intermittently (mostly) during the “picture selection tap”, but works every single time if I put a breakpoint in front, and (f11-step) into the load routine. Given the only code changes I’ve made to the program to date is to add a calibration button on the main screen.
Private Function LoadBitmap(fname As String) As Bitmap
Thread.Sleep(50)
Return storageDev.LoadBitmap(fname, Bitmap.BitmapImageType.Bmp)
End Function
Any thoughts on where to start looking for an error? As far as I can tell, I’m not mounting/unmounting the card. Also, if I break on the error, the fname path is absolutely correct, (and about 10% of the time, will load the file…)
Fez Hydra - Mainboard
2gb SD Card - Formatted Fat
T43 Display
USB Client DP with a 12v Supply