Hi Jim,
Thanks - I know the two's complement :-) I just got confused by the mismatch of
value and return type ... I looked at the prototype in the include files - it also
said UInt16 ... Then I got scared & had to have somebody put my mind at ease ...
Thanks.
Kind regards,
Brian
On Fri, 15 Feb 2002 12:58:04 -0800, Palm Developer Forum
<[EMAIL PROTECTED]> said:
>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/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/