If I understand your problem correctly, you are right that you do not
want to
store a pointer to your string in the database.  You'll likely want to
store the
actual contents of the string in your database.  Strings (or any
variable length
arrays) are a little trickier to store and retrieve from a database
because of,
well, their variable length.  As long as your string is properly
null-terminated,
however, it's pretty trivial to use system functions like StrLen() and
StrCopy()
(or DmStrCopy(), as your case may be) to properly allocate the correct
amount
of memory in your record and read/write the _contents_ of the string to
the
database, instead of storing a temporary pointer to that data.  I
wouldn't rely
on anything allocated in the dynamic heap to exist from one instance of
your
app to another.

-----Original Message-----
From: Gert Wurzer [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 8:17 AM
To: Palm Developer Forum
Subject: problem with Char* ->database


I just got a damn problem and hope that anyone here can help me:
My App generates and uses a number of objects stored in a database.
All changes the app makes to these objects are saved to the database.
Now I have troubles because one member of such an object is a string.
During runtime I create my objects in dynamic RAM and save all changes
to the database, but how can I save this whole string when I use a
reference
to it (Char*). A Handle to the string won't help me after closing the
app
and
restarting? Or is that wrong? Or am I just confused right now and
there is a simple solution?

Any help will be greatly appreciated!!!


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

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