At 09:30 PM 9/28/2002 -0400, you wrote:
>        I am trying to use my own Font with my application.  I am using 
> Codewarrior R7 with the PilRc plug-in.  I set up the compiler and file 
> mappings correctly,  and created a working rcp file.
>
>         However,  my c code is not compiling correctly,  which I don't 
> understand because all my syntax should be correct acorrding to the Palm 
> Os Documents.
>
>Here is my code,
>
>FontPtr fonte;
>fonte=MemHandleLock(DmGetResource('NFNT', 1000));
>FntDefineFont(255, fonte);
>
>I get two errors saying
>
>Error   : illegal implicit conversion from 'void *' to
>'FontType *'
>Starter.cpp line 336   fonte=MemHandleLock(DmGetResource('NFNT', 1000));

You are building as C++.  You need to explicitly cast the return type of 
MemHandleLock to a FontType pointer, by saying

     fonte=(FontType *)MemHandleLock(DmGetResource('NFNT', 1000));

>Error   : illegal implicit conversion from 'int' to
>'fontID'
>Starter.cpp line 337   FntDefineFont(255, fonte);

Again, C++ doesn't allow you to implicitly convert from a integer to a 
enumerated type, so you say

     FntDefineFont(255, (fontID)fonte);

>    Something is wrong with my Font pointer but I don't know what.  What 
> is wrong?

Nothing, its just language issues.  A C source file would have allowed both 
of these statements

-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com


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

Reply via email to