Hi Al, 
This is what I am doing.

------------------------------------------------
>FileHand out;
>Err errOpen;
>Err errClose;
        
>out = FileOpen(0, "MyApp.xml", 0, 0 ,
fileModeReadWrite | fileModeDontOverwrite, &errOpen);
   
>errClose = FileClose(out);
------------------------------------------------

This code works fine the first time. If the same code
is called again the second time, I am getting this
error.

----------------------------------------------
"MyApp just read from memory location 0x0003BEEE,
which is in an unallocated chunk of memory."
-----------------------------------------------

When I did a backtrace in PRC-Debugger, 

---------------------------------------------
Program received signal SIGTRAP, Trace/breakpoint
trap.
0x10c3ad72 in PrvValidateFileDescriptor ()
(gdb) backtrace
#0  0x10c3ad72 in PrvValidateFileDescriptor ()
#1  0x10c3acfa in PrvLockFileDescriptor ()
#2  0x10c3a064 in FileClose ()
#3  0x00048370 in StartApp () at MyApp.c:1206
#4  0x00047820 in MainFormHandleEvent (e=0x3d256) at
MyApp.c:686
#5  0x10c5c192 in PrvSendEventToForm ()
#6  0x10c5f4e2 in FrmDispatchEvent ()
#7  0x000472a6 in CheckOSVersion (bDisplayAlert=0
'\0') at MyApp.c:405
#8  0x00047080 in PilotMain (cmd=3, cmdPBP=0xd7c20000,
launchFlags=68)
    at MyApp.c:284
#9  0x10c0ea74 in PrvCallWithNewStack ()
#10 0x10c0e034 in SysAppLaunch ()
#11 0x10c934e0 in PrvAppLaunchLoop ()
#12 0x10c93156 in UIAppShellMain ()
#13 0x10c93628 in PilotMain ()
#14 0x10c93080 in __Startup__ ()
(gdb)
----------------------------------------------

When I did a dir using Palm Debugger for the XML file,

------------------------------------------------
name                    ID      total       data  
--------------------------------------------------
 TikTok.xml        000402DF    0.084 Kb    0.000 Kb  
 TikTok.xml        000402DF    0.084 Kb    0.000 Kb  
------------------------------------------------------Total:
2
--------------------------------------------------

Why is it showing two entries for the same file?
The error is coming when the FileClose() is called the
second time.

Thanks,
Rudra


--- "Albert J. Franklin" <[EMAIL PROTECTED]> wrote:
> RK,
> 
>    errP is a pointer; apparently it is pointing to
> location 0x42.  Try Err
> error (to allocate space on the stack for the error
> return) and pass &error
> in the FileOpen call.
> 
> Al
> ----- Original Message ----- 
> From: "Rudra" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum"
> <[EMAIL PROTECTED]>
> Sent: Thursday, November 06, 2003 8:38 PM
> Subject: Re: Writing an XML file from an application
> 
> 
> > Hi,
> > What is the error in the following lines of code?
> >
> > FileHand out;
> > Err *errP;
> >
> > out = FileOpen(0, "MyInfo.xml", 0, 0 ,
> > fileModeReadWrite | fileModeDontOverwrite, errP);
> >
> > I am geting the following error.
> >
> > "MyApp just wrote to memory location 0X00000042,
> which
> > is in low memory."
> >
> > Thanks,
> > RK
> >
> > --- kcorey <[EMAIL PROTECTED]> wrote:
> > > On Thu, 2003-11-06 at 17:25, Rudra wrote:
> > > > I want to store some information from a palm
> > > > application in XML format. Is it possible to
> write
> > > out
> > > > information from an application as an XML
> file?
> > > > This XML file will then be read by an
> application
> > > > running on a desktop.
> > > > I have not found much information on files for
> > > Palm
> > > > OS.
> > >
> > > You can write whatever content you want to a
> file on
> > > a memory card (SD
> > > or Memory stick) with the VFS* functions and
> then
> > > move the memory stick
> > > to a card reader that would allow programs on
> the PC
> > > to read the file.
> > >
> > > There's no built-in support for XML in the
> > > system...you'll have to roll
> > > your own, or use one of the pre-built libraries
> > > that're out there.
> > > Search the archives for more info on that.
> > >
> > > -Ken
> > >
> > >
> > > -- 
> > > For information on using the Palm Developer
> Forums,
> > > or to unsubscribe, please see
> > http://www.palmos.com/dev/support/forums/
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Protect your identity with Yahoo! Mail
> AddressGuard
> > http://antispam.yahoo.com/whatsnewfree
> >
> > -- 
> > For information on using the Palm Developer
> Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
> >
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to