Recent

Author Topic: Read / Write Operation under Windows CE  (Read 10505 times)

kickbit

  • New member
  • *
  • Posts: 5
Read / Write Operation under Windows CE
« on: January 26, 2010, 01:31:27 pm »
Hello!

I have build a small application for my WinCE device. The App is working fine, but now I want to read / write to a textfile on the SD card inside my system.

I tried to use AssignFile, Reset,Write,Writeln,... but it doesn't work. The app hangs after such operation.

Has anyone an idea and can help me with that?

Thanks in advance
  K.F.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Read / Write Operation under Windows CE
« Reply #1 on: January 26, 2010, 02:14:24 pm »
Almost impossible to say without information. ;-)

Have you tried using a StringList instead?
like:

Code: [Select]
var sl:TStringList;
begin
sl:=TStringList.Create;
sl.LoadFromFile('AFileName');
sl.SaveToFile('AnotherFileName');
sl.free;
end;

Or Memo1.Lines.LoadFromFile(..);

kickbit

  • New member
  • *
  • Posts: 5
Re: Read / Write Operation under Windows CE
« Reply #2 on: January 26, 2010, 02:58:34 pm »
Hello!

Yes, I have tried both examples, and both didn't work.

What infos do you need which could help solving this problem?

I really have no idea why this doesn't work and haven't found a tip in the internet.

Can you help?

Best regards
  Kay Foerster


theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Read / Write Operation under Windows CE
« Reply #3 on: January 26, 2010, 03:05:34 pm »
Can you help?

I don't think so. I'm not an expert for WinCE

Zaher

  • Hero Member
  • *****
  • Posts: 571
    • parmaja.com
Re: Read / Write Operation under Windows CE
« Reply #4 on: January 26, 2010, 04:20:37 pm »
Try to add the full path to your filename because Wince have no currect directory.

kickbit

  • New member
  • *
  • Posts: 5
Re: Read / Write Operation under Windows CE
« Reply #5 on: January 26, 2010, 04:32:34 pm »
Now a really stupid question!!!

How does a full path look like? Is there a C: or D: in WinCE?

Does a path look like this:
/data/mytext.txt
or
c:\data\mytext.txt

Thanks for your help
   K.F.

Zaher

  • Hero Member
  • *****
  • Posts: 571
    • parmaja.com
Re: Read / Write Operation under Windows CE
« Reply #6 on: January 26, 2010, 05:07:38 pm »
Without C: or D: just \
\data\mytext.txt

but you can make relative path from you exe file

s := Application.Location + 'mytext.txt';
or
s := Application.Location + '..\data\mytext.txt';

kickbit

  • New member
  • *
  • Posts: 5
Re: Read / Write Operation under Windows CE
« Reply #7 on: January 27, 2010, 06:02:43 am »
Thank you, I will try it this afternoon and let you know if it works!

Best regards
   K.F.

kickbit

  • New member
  • *
  • Posts: 5
Re: Read / Write Operation under Windows CE
« Reply #8 on: January 29, 2010, 03:23:25 pm »
Great, it worked!  :)

Thanks
  K.F.