>>>>> "HK" == Holger Klawitter <[EMAIL PROTECTED]> writes:
>> QRY-2 : If this creatorID is a string, how & where it is converted to UInt as 
>desired by DmOpenDatabaseByTypeCreator() system call ?
HK> It's not a string, it a 32 bit integer. Note the difference in the quotes:
HK> UInt32 id   = 'ABCD';
HK> Char  *text = "ABCD";

I don't think this is good answer, for how 'ABCD' is being treated,
is implementation dependent.

# And so, I don't beleave the way Palm is suggesting to create
# creatorID is good also, for it's implementation dependent.
# It works, but it's not a good idea.


If you put more then one character between ' then it is up to
compiler how you treat them. This includes 'type' of the constant.

Usually, 'ABCD' will generate memory image of 
         1st byte being 'A'
         2nd byte being 'B'
         3rd byte being 'C'
         4th byte being 'D'.

Type of the variable which is created on memory image will be
UInt32, for that's how it's being declared. As result, you'll get
variable equivalent to declaring:

UInt32 id   = ( 0x1000000L * 'A' )+( 0x10000L * 'B')
            +(0x100L *'C')+(0x01L * 'D');

on compiler for BIG endian machine.

---- 
Kenichi Okuyama@Tokyo Research Lab. IBM Japan. Co.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to