Wednesday, July 18, 2007

SetLength in VC++ will Throw Exception in Windows Mobile 6 emulator when file is in Shared Directory

While this posting is not really a .NET related issue, I am posting it anyway because the information is difficult to find on the web.

If you have a Windows Mobile 6 Emulator running (and appearently this error is also true for a few versions back), and you are sharing a directory between the desktop file system and the emulator (Shared Folder under the Emulator's Configure dialog will make a desktop directory show up as a \Storage Card directory on the emulator), then if you try to use CFile::SetLength on a file in the shared directory, the application will throw an exception for no apparent reason. I am also found other saying that FlushFileBuffers also has the same problem.

Here is the only other reference I have found to this problem:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=796830&SiteID=1

No comments: