Your new code is correct. The actual string is copied into the database.

Dave
"meg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> Thanks Dave, for the reply.  (and Lion).
>
> I figured that I couldn't use the handle.  One more question - does the
> DmWrite function copy the actual bits written at the adress it is given,
or
> does it just note the address?  For instance, if I changed my code to what
I
> have shown below, would it actually copy the words from the string into
the
> database, or would it simply note the pointer?  In other words, once the
> pointer q is no longer valid, would the values stored in the database
still
> be valid?
>
> Thanks,
> meg
> **************************code********************************
> typedef struct {
>   MemHandle QuestionAnswers;
>   UInt8 sessionFinished;
> } packed_question_type;
>
> //part of save database routine
>
>         //grab data from handle for packed question
>         q = MemHandleLock (packedQuestion.QuestionAnswers)
>
>         error = DmWrite(p, 0, &q, StrLen(q));
>
>         MemHandleUnlock(packedQuestion.QuestionAnswers);
>
>
>
>



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

Reply via email to