Hi,

I have developed an application for Palm Handheld
using CW IDE V 4.0.1 and Palm SDK 3.0 .
I downloaded my Application onto my HAndSpring Visor
Prism (color device with Palm OS v 3.5.2H on it).
I dont have any problem with this device.

But when I download the same application onto my other
HandSpring Visor (Black and white device with 2 MB
memory and Palm OS v 3.1H2 on it), I dont have any
problem when I am running the application on this
device too.But when I exit my application,I get Fatal
Error and I have to do
a Soft Reset to exit my application.

I am not sure whether this has anything to do  with
different OS version on the device or whether it's my
code problem.
I have included the code for my Stop Application and
also code on how I save my data onto my database.

Does anybody know what's going on here??

static void StopApplication( void )
{
        Err err;
        CloseCOM();
        if(setFont)
        FntSetFont(curFont);
        FrmCloseAllForms();
        err = DmResetRecordStates(drgCtrDB);
        DmCloseDatabase(drgCtrDB);
        err = DmResetRecordStates(HexDragDB);
        err = DmCloseDatabase(HexDragDB);
}

//This is how I save the data.
Boolean exist = false;
Boolean handled =false;
UInt index = 0,numRecords,buttonID;
VoidPtr  textPtr;
VoidHand myRecord;
saveDataToDatabase *s,theStructure;
        
numRecords = DmNumRecords(drgCtrDB);
for(index = 0;index<numRecords ;++ index)
        {
        myRecord = DmGetRecord(drgCtrDB , index);
        s = MemHandleLock(myRecord);
//      theStructure = *s;
        if(StrCompare(SN,s->serialNo) == 0)
                {
                exist =true;
                buttonID = FrmAlert(RecordExistsAlert);
                if(buttonID == RecordExistsYes )
                        {
                        //textPtr=MemHandleLock(myRecord);
                        DmWrite(s,0,&saveRecord,sizeof(saveRecord));
MemHandleUnlock(myRecord);
DmReleaseRecord(drgCtrDB, index, true);
FrmAlert(SavedSuccessAlert);
handled = true;
break;
 }
 else if(buttonID == RecordExistsNo)
{
handled = true;
MemHandleUnlock(myRecord);
DmReleaseRecord(drgCtrDB, index, false);
break;  
}  
 }
else
{
MemHandleUnlock(myRecord);      //MemPtrUnlock(s)??????
DmReleaseRecord(drgCtrDB, index, false);        
}
}
        
if(!exist) 
{
index = 0;
myRecord = DmNewRecord(drgCtrDB , &index
,sizeof(saveDataToDatabase));//textHandle contains
actual record index.
                //If the allocation failed ,display a warning.
                if(!myRecord)
                {
                FrmAlert(DeviceFullAlert);
                return (false);
                }
                textPtr = MemHandleLock(myRecord);
                DmWrite(textPtr,0,&saveRecord,sizeof(saveRecord));
MemHandleUnlock(myRecord);
DmReleaseRecord(drgCtrDB, index, true); 
FrmAlert(SavedSuccessAlert);
handled = true;
} 
return handled;
}

Thanks in advance for any guidance.
Amritha,

=====
Life would be dull and colourless but for the obstacles that we have to overcome and 
the fights that we have to win.

Amritha.

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

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

Reply via email to