Char * pChar = (Char*)MemPtrNew(5 * sizeof(Char*));
           StrCopy(pChar, "Orders\0");

You have not allocated sufficient space in pChar.

You probably don't want to say "5 * sizeof(Char *)" as this allocates space
for 5 pointers to characters.  The base item is (char) not (char *).  Also,
"Orders\0" is eight characters long.  You probably don't want the explicit
\0 since the string constant "Orders" includes a \0 already.  Time to grab a
C++ manual...

Dennis Leas
-----------
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Matt
Andreko
Sent: Friday, June 06, 2003 2:32 PM
To: Palm Developer Forum
Subject: problem writing to database (beginner)


I have some code which just needs to write to a single table database.
however, it's dying on a line, that i'm not sure how to fix.  (i'm new to
palm and c++)

I've snipped most of the important parts here.  It is dying on one of two
lines, being:
StrCopy(pChar, "Orders\0");
DmStrCopy(s, 0, pChar);


can anyone help me figure out what would be happening?
I have posted full source code at
http://www.criminalsmostly.com/~mandreko/scanner.zip if it helps.




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

Reply via email to