---------- Forwarded message ----------
From: Sriram V <[EMAIL PROTECTED]>
Date: Aug 19, 2006 1:06 PM
Subject: Re: trouble with PhnLibCount
To: [EMAIL PROTECTED]

hi thanx the reply...
sorry...that was a mistake while typing..this is the corrected code:
 
/*********code snippet***********************/
UInt16 LibRef;
PhnAddressList list;
PhnAddressHandle addressH;
unsigned short cnt;

err = PhnLibGetOwnNumbers (LibRef,&list);
if (err==0)
{
   err=PhnLibCount(smsLibRef, list, &cnt);                             //returns n=0..though there r entries in addr book
     if(err==0 && cnt>0)
     {
//it is a GSM phone..i've written that part
//before this snippet
           err = PhnLibGetNth (LibRef, list, 1, adrH);                   
           if (err==0 && addressH!=0)
           {
 
            numberPtr = PhnLibGetField(LibRef, addrH,   phnAddrFldPhone);                                                                                                                      MemHandleFree(addressH);
           }
       }
}

the count returned is still 0 though  there entries in the phone memory as well as  SIM.
please help me out..
thanx
sriram
 
On 8/18/06, Jim Morris <[EMAIL PROTECTED] > wrote:
Should you be mixing LibRef and smsLibRef?
V. Sriram wrote:
> hi all,
> please help me out on this one..its really urgent.
> i am trying to retrieve name and phone number of contacts from address book. but PhnLibCount gives count as 0.
>
> this is my code:
> /*********code snippet***********************/
> UInt16 LibRef;
> PhnAddressList list;
> PhnAddressHandle addressH;
> unsigned short cnt;
>
> err = PhnLibGetOwnNumbers (LibRef,&list);
> if (err==0)
> {
>     err=PhnLibCount(smsLibRef, list, &cnt);                           //returns n=0..though there r entries in addr book
>       if(err==0 && cnt>0)
>       {
> //it is a GSM phone..i've written that part
> //before this snippet
>           err = PhnLibGetNth (LibRef, list, 1, adrH);                     if (err==0 && addressH!=0)
>           {
>              numberPtr = PhnLibGetField(smsLibRef, ddrH,                   MemHandleFree(addressH);
>             }
>       }
> }
>
> kindly respond
> regards,
> sriram
>

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

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

Reply via email to