CharPtr disptext=MemPtrNew(sizeof(newtext));


This will allocate enough memory, if newtext is a Char array, not if it is CharPtr (or char*). Try running it on the emulator. If you're not allocating enough memory you'll get a 'Write over memory manager data structures' or a 'Write on non-allocated chunk' error from POSE.

What you are doing should work. You can use FldSetTextPtr, but then make sure the field is not editable (in the resource properties). PalmOS will not try to move the chunk. Perhaps you could send me the smallest portion of source code that exhibits the problematic behaviour. I'll try to spot any error.

Stuart Norton wrote:

CharPtr disptext=MemPtrNew(sizeof(newtext));
I'm then pointing the field to disptext, copying newtext to disptext using
StrCopy, and updating the field. I'm hoping this procedure would work for
writing to the display but it doesn't. Firstly, is using "sizeof(newtext)"
acutally assigning enough memory, and secondly why doesn't it work? I read
somewhere that you don't need to use a text handle for read only fields, but
can just use FldSetTextPtr() as I am doing.

Aaron: Thanks for the code. I'll try it if no-one writes back with a Ptr
solution.

Stuart Norton,
Project Director,
Southampton 'Sun Surfer'
University of Southampton, UK

--
Sergio Carvalho
---------------
[EMAIL PROTECTED]

If at first you don't succeed, skydiving is not for you
 

Reply via email to