Hi folks,

I'm trying to save the results from a form with 2 fields in it into my 
application's database. In the debugger, everything appears to be 
working ok up until I get to the DmWrite call, when my app throws a bus 
error in POSE.

static void EditReminderFormSave()
{
        Reminder r;
        MemHandle h, h2;
        FieldType* fld;
        UInt32 size;
        
        // Get Record from DB
        h = DmGetRecord( gDB, gCurrentRecord - 1 );
        UnpackReminder( &r, MemHandleLock( h ) );
        
        // put the text from the fields into the unpacked record
        fld = GetObjectPtr( EditReminderButtonTextField );
        r.buttonText = FldGetTextPtr( fld );
        fld = GetObjectPtr( EditReminderReminderTextField );
        r.reminderText = FldGetTextPtr( fld );
        
        // pack the revised reminder into a new memory handle
        h2 = MemHandleNew( 1 ); // PackReminder will resize the handle 
appropriately
        PackReminder( &r,  h2 );
        
        // write the new packed record to the DB and release the record
        size = MemHandleSize( h2 );
        DmWrite( MemHandleLock( h ), 0, h2, size );
        MemHandleUnlock( h );
        DmReleaseRecord( gDB, gCurrentRecord - 1, true );

}

Can anyone give me a clue as to where this bus error is coming from? 
Thanks in advance for any help!

Best,
Sean


-- 
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