At 12:04 AM 12/26/2001 +1100, you wrote:
You have "record" defined as a pointer but you never allocate memory for it
to point to. Consider change it from testRecItemPtr to testRecItem.
Bob
>typedef struct
>{
> Char* Name;
> Char* Note;
>} testRecItem;
>
>typedef struct
>{
> char NameNote;
>}testRec;
>
>typedef testRecItem* testRecItemPtr;
>typedef testRec* testRecPtr;
>
>//*************************************************************************
>static void ShowRecord(UInt16 index)
>{
> MemHandle recordH;
> testRecPtr recordP;
> testRecItemPtr record;
>
> recordH = DmQueryRecord(testDB, index);
> if (recordH != NULL)
> {
> recordP = MemHandleLock(recordH);
> UnPackRecord(record, recordP);
> MemHandleUnlock(recordH);
>
> SetText(GetObjectPtr(MainNameField), record->Name);
> SetText(GetObjectPtr(MainNoteField), record->Note);
> }
>}
>
>static void UnPackRecord( testRecItemPtr record,
>testRecPtr src )
>{
> Char *p;
>
> p = &src->NameNote;
> //The error occurs just right here
> record->Name = p;
> p += StrLen(p) + 1;
> record->Note = p;
>}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/