At 02:38 PM 10/8/2004, you wrote:
I am trying to save a string to a database.  I gets created OK and the
string is saved properly upon creation. However, if I try to add data and
resave, the DmFindDatabase returns -2113930468.  I thought it would return
either a zero or the index number of the db. My code follows.  Can someone
give me some guidance on what I'm doing wrong?

For one thing, sizeof(char *) is always 4, no matter what string the pointer is pointing to. Think about using StrLen instead.


Also, for allocating a string that's just going to be used in the lifetime of a single function, MemPtrNew is better than MemHandleNew/HandleLock/HandleUnlock/HandleFree -- much less code, and it's better to use a MemPtr for memory that is going to be locked until it's freed.


-- Ben Combee, Technical Lead, Developer Services, PalmSource, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Developer Fourm Archives: http://news.palmos.com/read/all_forums/


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

Reply via email to