Hello Maggie,
First off, looking at your code, I would suggest getting the error code back
and checking it rather than passing NULL. Also when you open a file in
fileModeReadWrite, any existing version of the file is discarded and you get
a "fresh" stream. So in the second part you should set your mode to
fileModeUpdate to allow you to read and write on the stream.
Hope that helps,
Aaron Hansen
> -----Original Message-----
> From: maggie lim [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 12, 2001 5:15 PM
> To: Palm Developer Forum
> Subject: file streaming
>
>
> i'm writing a file streaming in the palm to store the data,
> however it
> doesn't seem to create a file, read stream and write stream.
> thus i hope
> anyone with the sample code can pass to me.
>
> here's my code
>
> // glocal variable
> FileHand IpSetting;
> char temp[16];
> char temp1[16];
> DWord mode;
>
>
> mode=fileModeReadWrite;
> IpSetting=FileOpen(0,"Ip.txt",sysFileTFileStream,0,mode,NULL);
> FileWrite (IpSetting, temp, 1, strlen(temp), NULL);
> FileClose(IpSetting);
>
> IpSetting=FileOpen(0,"Ip.txt",0,0,mode,NULL);
> FileRewind(IpSetting);
> FileRead (IpSetting, temp1, 1, 16, NULL);
> SetFieldText(MainStatusField, temp1, 79, true);
> FileClose(IpSetting);
> ______________________________________________________________
> ___________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/