Hello!

I'm loading the content of a database into a table and doing this
with a
TblSetLoadDataProcedure (table, 1, ListFormGetRecordField);

In ListFormGetRecordField I figured out how to do it, but I don't want
to send just one textfield to the table. I would like to combine two
fields of the database, create a handle to this textstring and send this one
to the TblSetLoadDataProcedure.
The first code example works with getting just a handle to the
database record, but the second one doesn't work.
Any ideas?

Many thanks, Dyk


    recordH = DmQueryRecord(gItemsDB, recordNum);
    ErrFatalDisplayIf ((! recordH), "Record not found");
    packedRecordP = (PackedItems *) MemHandleLock(recordH);

    UnpackItems(&record, packedRecordP);

   // Calculate the offset from the start of the record.
   recordP = MemHandleLock(recordH);

  *textOffset = sizeof(UInt32) + sizeof(VeranstaltungDateTimeType);
  *textAllocSize = StrLen (record.titel) + 1;  // one for null terminator
    MemHandleUnlock(recordH);

   *textHP = recordH;

// the codesample above works great, the second one does not work!

 StrCopy (strP, record.titel);
 *textOffset =  0;
 *textAllocSize = StrLen (strP) + 1;  // one for null terminator

 // get some space in which to stash the string.
 txtH = MemHandleNew(  StrLen( strP ) + 1);
 txtP = MemHandleLock( txtH);

 // copy the string.
 StrCopy( txtP, strP );

 MemHandleUnlock( txtH);

 *textHP = txtH;


Any idea why the second example does not work and crashes with an alert:

The program X just changed the emulated program counter  to 0x62616C6C. This
address is invalid because it's neither in  ROM nor in RAM..


Many thanks,

dyk



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

Reply via email to