I have pointer and I allocated space using MemPtrNew.

static char **PtrPed;
PtrPed=MemPtrNew(100);

Now, I need fill up with code key of my records.
I needed to allocate space for each member again to use StrCopy?

for (i=0;i<NumRegsPed;i++)
   {
   HandlePed = DmQueryRecord(PVPed, i);
   RegPed=MemHandleLock(HandleTemp);
   UnPackPedido(RegPed, MemHandleLock(HandlePed));
   if (StrCompare(RegCli->CGCCli,RegPed->CgcCpf)==0)
      {
      PtrPed[i]=(CharPtr)MemPtrNew(10); // Now I allocate
again***************
//************************************
//
//      If I just use PrtPed[i]=RegPed->NrPed I will damage my db when I
free the 
//      pointer?
//      If I free PtrPed I'm doing for all of its members?
//******************************
      StrCopy(PtrPed[i],RegPed->NrPed);
      iNumPedCli++;
   }
   MemHandleUnlock(HandlePed);
   MemHandleUnlock(HandleTemp);
}
MemHandleFree(HandleTemp);
LstSetListChoices(LstPed, PtrPed, iNumPedCli);

Thanks in advance...
Roberto Amorim

-- 
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