Hi,
This isn't really a Palm programming question - its a C question. There are
probably more appropriate places to ask this. Even an introductory C
programming book would help you out here.
The basic problem is that the function MemLockHandle returns a pointer to a
void (void *) and you are trying to assign this to a variable that is a
character pointer (char *). This is why you get the illegal conversion
warning.
To get around this, you can cast the result of the function to a character
pointer like this:
recText = (char *) MemHandleLock(recHandle);
Dan
> -----Original Message----->
> Dear friends:
>
> In my applications I'm using this piece of code to retrieve the clipboard.
> I didn't have had any problem, but now that I'm trying to improve another
> application in wich I included this code, an error message ("void to char
> illegal conversion") appeared. What is wrong? How can I solve
> it? If not,
> how shoul I convert clipboard information to text?
>
> -----------------
> Word pasteLen;
> VoidHand recHandle;
> CharPtr recText;
>
> recHandle = ClipboardGetItem (clipboardText, &pasteLen);
> recText = MemHandleLock(recHandle); //the error appears in this line
> -----------------
>
> Thank you very much,
> Farzin
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/