Hi,
I am a newbie and i have tried all i could so i am turning to you guys.  I
am trying to modify the MemoPad still, and have removed the secret box in
the details form but everything else is the same as MemoPad tutorial.  The
application now loads fine but i am getting a error saying that my
application is reading from memory location 0x00000002, which is low in
memory when a new form is to be loaded (tapping "NEW" button or categories).
I just wanted to know how to go about finding out the problem.
Below is what i think is the code that is causing this.
Thanks
Madina
P.S. I am using a codewarrior lite in Win ME and POSE.

static Boolean CreateRecord(void)
{
 Ptr  p;
 VoidHand memoRec;
 UInt  index = 0;
 Err  error;
 Char  zero = 0;
 UInt  attr;   // P11. record attributes (category)

 // Create a new first record in the database
 memoRec = DmNewRecord(EntryDB, &index, newEntrySize);

 // Lock down the block containing the new record.
 p = MemHandleLock(memoRec);

 // Write a zero to the first byte of the record to null terminate the new
memo string.
 error = DmWrite(p, 0, &zero, sizeof(Char));

 // Check for fatal error.
 ErrFatalDisplayIf(error, "Could not write to new record.");

 // Unlock the block of the new record.
 MemPtrUnlock(p);

 // P11. Set the category of the new record to the current category.
 DmRecordInfo (EntryDB, index, &attr, NULL, NULL);
 attr &= ~dmRecAttrCategoryMask;    // Remove all category bits
 if (CurrentWard == dmAllCategories)
  {
  // Since the user isn't looking in any particular category place
  // the new record in the unfiled category.
  attr |= dmUnfiledCategory;
  }
 else
  {
  // Set the attribute bits to indicate the current category.
  attr |= CurrentWard;
  }
 DmSetRecordInfo (EntryDB, index, &attr, NULL);
// Release the record to the database manager.  The true value indicates
that
 // the record contains "dirty" data.  Release Record will set the record's
 // dirty flag and update the database modification count.
 DmReleaseRecord(EntryDB, index, true);

 // Remember the index of the current record.
 CurrentRecord = 0;
 return(true);
}



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