The error message suggests that the argument must be cast to the types
shown. Try StrCopy((char*)p, (char*)str).
AA> I keep getting an error in this function, and I don't know why!!! This
AA> function is used to put in a field some data from a database read with
AA> another function...
AA> The compiler show me this error:
AA> "function call 'StrCopy({lval} char *, {lval} void *)' does not match
AA> 'StrCopy(char*, const char *)' "
AA> I use Codewarrior v9.
AA> static FieldPtr SetField(UInt16 formID, UInt16 fieldID, MemPtr str)
AA> {
AA> FormPtr form;
AA> UInt16 obj;
AA> FieldPtr field;
AA> CharPtr p;
AA> VoidHand h;
AA> form = FrmGetFormPtr(formID);
AA> obj = FrmGetObjectIndex(form, fieldID);
AA> field = (FieldPtr)FrmGetObjectPtr(form, obj);
AA> h = (VoidHand)FldGetTextHandle(field);
AA> if (h == NULL)
AA> {
AA> h = MemHandleNew (FldGetMaxChars(field)+1);
AA> ErrFatalDisplayIf(!h, "No Memory");
AA> }
AA> p = (CharPtr) MemHandleLock(h);
AA> StrCopy(p,str); // <------------------------
AA> MemHandleUnlock(h);
AA> FldSetTextHandle(field, (Handle)h);
AA> }
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/