Make sure that Text is pointing to a valid memory location, and that
space is large enough to contain the entire TextP;


Jim Duffy wrote:
> 
> I hate to ask this since so much has already been posted about fields,
> but....
> 
> I can't seem to be able to get the text from a field and copy it into a
> string.  Setting the text to the field is no problem.
> 
> the code is
> 
> static void GetFieldText(UInt32 FieldID, char *Text)
> {
>  FieldPtr FieldP;
>  Handle FieldHand;
>  CharPtr TextP;
> 
>  FieldP = (FieldPtr)GetObjectPtr(FieldID);
>  FieldHand = FldGetTextHandle(FieldP);
>  TextP = MemHandleLock(FieldHand);
>  StrCopy(Text,TextP);
> }
> 
> I also tried
> 
> {
>     TextP = FldGetTextPtr(FieldP);
>     StrCopy(Text,TextP);
> }


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to