Thanks. Now I can copy Database name to an array. However, when I exit my
program, the system crash, and the error message is "Minor error while
exiting app: un-freed check at 0x00F7E1D8, size 32 (ownerID 2). I use this
function to free memory when exit my program
===================
case frmCloseEvent:
Int16 i;
for (i=0; i<total; i++) {
MemPtrFree((MemPtr) NameTemp[i]);
}
NameTemp = 0;
total = 0;
=====================
Here is the search Database I use
======================
char **NameTemp; // global variables
int total; //global variable
void SearchDB (ListType *lst, long Type) {
LocalID dbID;
Int16 i, index=0;
char *nameP;
char *NameList[MaxItems];
NameTemp = NameList; // Save to free memory when exit
for (i=0; i<DmNumDatabases(0); i++) {
>>dbID = DmGetDatabase(0,i);
>>DmDatabaseInfo(0,dbID,nameP,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,&type,
NULL);
>>if (type == Type) {
>>>>NameList[index] = (char *) MemPtrNew(32);
>>>>StrCopy(NameList[index],nameP); // Copy to Array
>>>>index++;
>>}
}
total = index;
}
Thanks again
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/