manish jaggi wrote:

>I am trying to add items dynamically to a list
>but there is a problem in LstSetChoices()
>the error is This Application has just Read from low Memory
>
>MemHandle HCity[10];
>char List[10][30];
>char *List1[10];
>-- allocate memory for HCity----
>
>MemHandle HRecord;
>    HRecord =MemHandleNew(40);
>   for(int i=counter;i< counter + 10 ;i++)
>   {
>     locked=1;
>     int k  = i - counter;
>        GetCity(HCity[k],i,HRecord);
>        StrCopy(List[k] ,(char*)MemHandleLock(HCity[k]));
>        List1[k] = List[k];
>   }
>
>problem Line:::->   LstSetListChoices ((ListType*) FrmGetObjectPtr
>(frmP, FrmGetObjectIndex(frmP, AtlasCityList)), (char**) List1, 10);


I suspect your problem may be due to uninitialised members of the HCity 
array (it appears that they are being passed by value).  You may also want 
to check if MemHandleLock( ... ) fails, or FrmGetObjectPtr( ... ) or 
FrmGetObjectIndex(...).  Also, was the frm value initialised to 
FrmGetActiveForm()?

HTH,
Martin



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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

Reply via email to