i want to create the list of todo item for due today 

in my application and 4 that i am  loading just only the description field in 
the list but it is giving the error message invalid pointer 4 that and when i 
look the code of actul todo they r loading it in a table 
so i cant understand that why it is creatingg problem .
here is my code

static void ToDayDue(FormType* frm)
{
                
   Int32 Rec=0;                         
   LocalID dbID; 
   DmOpenRef dbPP;
   Int16 result;        
   MemHandle recordH;
   DateTimeType today;
   ToDoItemPtr     toDoItem;
    UInt16 indexP=0;
    Int16 offset=0;
   
        static char **ItemType; 
        TimSecondsToDateTime (TimGetSeconds(),&today);  
        
           dbID = DmFindDatabase (0,toDoDBName);
           if(dbID)
                {                       
                 dbPP=DmOpenDatabaseByTypeCreator 
('DATA',sysFileCToDo,dmModeReadWrite);                 
                 ItemType = (Char**)MemPtrNew(1 * sizeof(Char*));
                 
                 while (true)
         {
                DmSeekRecordInCategory(dbPP,&indexP,offset,dmSeekForward,0);
                                
                if (DmGetLastErr()) break;               
                recordH = (MemHandle)DmQueryRecord (dbPP,indexP);
                toDoItem = (ToDoItemPtr) MemHandleLock (recordH);
                        
                if (DateToInt (toDoItem->dueDate) == toDoNoDueDate) 
                {
                        if (!(toDoItem->priority & completeFlag))
                        {
                                
FrmCustomAlert(DateAlert,toDoItem->description,NULL,NULL);  //giveng error 
message at this line 
                                ItemType[indexP] = 
(Char*)MemPtrNew(sizeof(toDoItem->description));
                                StrCopy(ItemType[indexP],toDoItem->description);
                                break; 
                                                        
                        }
                }                                                               
                        result = DateCompare(today,toDoItem->dueDate);
                        if((result==0) && (!(toDoItem->priority & 
completeFlag)))
                        {                                       
                                
                         ItemType[indexP] = 
(Char*)MemPtrNew(sizeof(toDoItem->description+1));             
                         StrCopy(ItemType[indexP],toDoItem->description);       
                 
                         break;  
                        }
                        
                        
                        
                        MemHandleUnlock (recordH);                      
             }  
             lst = 
(ListType*)FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,ToDayDueList));  
                 LstSetListChoices (lst,ItemType,indexP);
                 
                                
        }    
                     
                        
}


the code is only 4 to show the single item in the list than i extand later but 
it is giveng error 4 toDoItem->description
invalid pointer and why idont under stand to retrive the description
is their and thing wrong to retrive the description frm data base of todo.
please help me out 

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

Reply via email to