At 9:36 PM -0100 2002/02/15, [EMAIL PROTECTED] wrote:
>What is the return value of DmFindResource if a given resource cannot be found?    In 
>the Reference guide it says:
>
>"Returns index of resource in resource database, or -1 if not found."
>
>Well - the return type of DmFindResource is UInt16 ........ :-)
>
>Should I check against 0xffff?

Yes.

Just FYI for anyone who's confused... 0xFFFF = -1 for 16-bit integers, and 0xFFFFFFFF 
= -1 for 32-bit integers. The bit pattern is identical, so this is really about 
interpretation. The documentation is clearly misleading since the data type is 
unsigned, but its heart is in the right place. ;o) In any case, you might want to 
brush up on twos compliment integer representations if you're still confused.

Regards,

Jim Schram
PalmSource Inc.
Partner Engineering


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

Reply via email to