Click to See Complete Forum and Search --> : C++ for Palm OS


Eek
March 26th, 2003, 08:21 AM
hi........anyone here knows about C++ programming for Palm OS (Code Warrior)???........I have just started to learn about it.......now I am particularly focus on the database construction in Code Warrior........here's how it looks like:

#define CREATORID 'john_Woo'
#define DBTYPE 'Data'
#define DBNAME 'my_Data'

Err err = DmCreateDatabase( 0, DBNAME, CREATORID, DBTYPE, false );

when I compile it I got this error:

"error: illegal implicit conversion from 'unsigned long long' to 'const char *'"

this error appears to be from the last parameter I passed into the DmCreateDatabase(). Since the Code Warrior 8.0 didn't provide me any syntax references towards all the syntaxes used in Palm OS programming..........so if anyone can help me with this I would be much more appreciated.....thanks

Gabriel Fleseriu
March 26th, 2003, 08:31 AM
#define CREATORID "john_Woo"
#define DBTYPE "Data"
#define DBNAME "my_Data"

Eek
March 26th, 2003, 08:42 AM
eh........thanks for reminding......but that don't seems to be the problem here...........the real problem came from the last parameter I passed into the DmCreateDatabase().........it seems to me that the C++ compiler was not able to identify the "false" input (which is a boolean) I have passed in and thus, it generates the error as mentioned before..........so I was puzzled over what kind of data type that parameter actually holds....is it really a bool (as mentioned from the lesson I have learned) or something else???

Philip Nicoletti
March 26th, 2003, 09:09 AM
Are you sure that the problem is the last argument ?

According to the following link :

http://www.sdpug.com/PDFs/Instant%20Palm%20OS%20Applications%20Ch11.pdf

The prototype for DmCreateDatabase() is:


Err DmCreateDatabase(UInt16 cardNo, const Char *nameP, UInt32 creator,
UInt32 type, Boolean resDB);


And the sample call given is:


Status = DMCreateDatabase(0,"FirstData", 'IP99', 'DATA', false);


so the second argument uses double quotes (you had single quotes in
your example). Also, since the third and fourth argurments are of
type UInt32, I assume that they would be limitted to 4 characters
(Although I really don't know what the types given mean). Your
example had more than 4 characters for the third argument.

Eek
March 26th, 2003, 09:35 AM
Thanks for the link............the resons I am sure about the problem is that the compiler itself has highligted the error came at the closing bracket of the DmCreatedatabase()...........I have tried the ways u have suggested but the problem still persist................is it possible that my compiler setting wrong???