Hi,
I am running a strange problem or something I had never encountered before.
When I run on the real palm, I got an error called NULL string passed. But
it runs successfully in my emulator.
After several of troubleshooting,
I found the problem in lies in this function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
static void GetClassList(Char *cL[])
{
#define noRecord -1
int i, j;
UInt16 totalRecords;
Char *className = {"NPET-Class"};
totalRecords = CountRecord(className);
if( totalRecords != noRecord)
{
for(i = 0; i < totalRecords ; i++)
{
cL[i] = MemPtrNew(StrLen(ReadRecord(className, i) + 1));
//remeber to
free
StrCopy( cL[i] , ReadRecord(className,i));
}
CloseDB();
setDBPtr(); //act as a separator
for( j = i + 1; j < MAXOFCLASS; j++)
*cL[j] = NULL;
}
else
;
//Tell the user to setUP the record
}
If I comment out the StrCopy, it runs fine on the real palm.
I have checked that I am able to get the string passed from the ReadRecord.
I am using Palm IIIe and emulator is Palm V
SDK 4.0;
Is it something wrong with my StrCopy or cL[]? Thanks in advance.
Low Pui Kuen
_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/