thanks john 4 u kind help and time very thanks to u.
I solve my problem the iwrk is that 

1)i initialise my global variable static char* item;with 0 means  static char* 
item=0;    and the write that function like this

static void TodayAppList(FormType* frm)
{ 
SysDBListItemType          *dbListIDsP; 
MemHandle                  dbListIDsH; 
static UInt16              dbCount = 0; 
UInt16 counter; 
Boolean                    status;                 
ListType*  lst;
static char **ItemType; 
 
UInt16 ListItemNum;
 
        if(ItemType)
         {
                 for(counter=0;counter<dbCount;counter++)
                        {
                                MemPtrFree(ItemType[counter]);
                        }                       
                        MemPtrFree(ItemType);                   
                        dbCount=0;               
                }
                   if(frm)
                   {
        
           status = SysCreateDataBaseList(sysFileTApplication, 0,&dbCount, 
&dbListIDsH,true); 
           ItemType = (Char**)MemPtrNew(dbCount * sizeof(Char*)); 
     
            dbListIDsP = (SysDBListItemType*)MemHandleLock (dbListIDsH); 
     if (status == true && dbCount > 0)   
       { 
        for (counter = 0; counter < dbCount; counter++) 
          {              
                   ItemType[counter] = (Char*)MemPtrNew(dmDBNameLength+1);      
           
                        StrCopy(ItemType[counter], dbListIDsP[counter].name);   
                                         
          }  
          
                    lst = (ListType*)FrmGetObjectPtr(frm,FrmGetObjectIndex(frm, 
TodayPrefList));          
            LstSetListChoices (lst,ItemType,dbCount);           
            ListItemNum= LstGetSelection (lst);             
            item= LstGetSelectionText(lst,ListItemNum); 
   
            
             for (counter = 0; counter < dbCount; counter++) 
                 {                         
                                if( StrCompare(dbListIDsP[counter].name,item) 
== 0 )
                                         CreatorId=dbListIDsP[counter].creator; 
                                 
                 }                      
             MemHandleUnlock(dbListIDsH);            
             MemPtrFree(dbListIDsP);
       }   
      }  
  }

means the same way u told  me .
2)i again call the function at the time of exit of application 
TodayAppList(0);in the same manner u told  me.

They way i m wrg is   at that time i comment out the line in the function to 
free memory and make the variable global and free memory at time of exit the 
application.
but 
 i dont understand 1 thing that now i dont need to free the item any where is 
my application even not need to initialise any where more like this which i m 
doing that time.
item = MemPtrNew(20);
MemSet(item,20,'\0');  
at the start of application bcz if i not do this it create problem to start the 
application.
thanks 1 again.

do help me to solve my second problem 
How do i change the bitmap dynamically on graphic button as i sescribe is the 
previous thread if u can 

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

Reply via email to