Solved

File Handling in WinCE

Posted on 2003-11-07
6
1,227 Views
Last Modified: 2013-12-27
What is the best way for file handling in WinCE. NET 4.1. Is it safe enough to use the winCE API's, i.e CreateFile, ReadFile, WriteFile, SetFilePointer etc. If not then please suggest the best way for handling files.
0
Comment
Question by:manas_ghosal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 200 total points
ID: 9702908
For MFC programs, use the CFile class for binary files or the CStdioFile class for text files.

For non-MFC programs, use the API functions CreateFile, ReadFile, WriteFile, etc.

You can also use the C Run-Time library functions _tfopen, fread, fwrite, etc.

But those classes and library functions all end up with calling the API functions.
0
 
LVL 3

Expert Comment

by:cindy_k
ID: 9703798

If you are using an eMbedded Windows CE 4.1 device just be careful of the file size while you are writing.
I found a bug in the Operating System, where you can continue to write files even after there is no more storage memory left available. Writefile will continue working and it will allow you to write into the Program memory section of the memory which corrupts the whole operating system and you are forced to Cold Boot to fix it, since files are not deleted on a Warm Boot.
My company did report this problem to Microsoft.

Even with this problem chensu is correct. Those are the functions to use in CE to create files.

Good Luck,
Cynthia
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 9733356
what language are you writing the code?
0
 

Expert Comment

by:suminda
ID: 9830004
if u langvage are evc++ i thing best using crearte file
if u write to file best way write CHUNK (1 Chuck size 4kb) read also same
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
A short article about problems I had with the new location API and permissions in Marshmallow
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question