Well here is the working code on a Treo (only)

#include <HsAppLaunchCmd.h>    // Part of the PalmOne SDK Headers

static Boolean callbackFunc(void* ref)
{
    return false;
}

Boolean Lookup(char * number)     // number should be a straight 11 digit 
number like 18005551212
{
    Boolean rv = false;
    SysNotifyParamType params;
    AddrCallerIDParamsType lookupParams;
    MemSet(&params, sizeof(params), 0);
    MemSet(&lookupParams, sizeof(lookupParams), 0);

    params.notifyType = addrAppNotificationCmdCallerID;
    params.notifyDetailsP = &lookupParams;


    lookupParams.lookupString = number;
    lookupParams.formatString = "^name"; // you can change this to whatever 
you want
    lookupParams.callback = callbackFunc;
    UInt32 plainVal = 0;
    lookupParams.ref = (void*)&plainVal;


    AppCallWithCommand('addr', sysAppLaunchCmdNotify, &params);
    if(lookupParams.resultString)
    {
        FrmCustomAlert(10024, "Name is ", lookupParams.resultString, ".");
        MemPtrFree(lookupParams.resultString);
        rv = true;
    }
    else
    {
        FrmCustomAlert(10024, "Name not found!", "", "");
    }
    return rv;
}

Good luck,
LionScribe


"Scott Erickson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Is there anyone that can help me with this problem???  Ive read the header 
> files, found nothing in the HS documentation.  The peoblem is that after i 
> set all the fields of the AddrLookupParamsType, SysNotifyParamType, 
> AddrHsLookupUserDataType  and send it to the address book, the resualt 
> argument gets set to NULL and no error code is returned by the error = 
> SysAppLaunch(cardNo, dbID, 0, sysAppLaunchCmdNotify, &notify, &result); 
> call.  I have no idea why its not working.
>
>
> -- 
>
>
> Scott Erickson
> Software Engineer, FB-4, Inc.
> [EMAIL PROTECTED]
> "Scott Erickson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Ive been trying to figure this out for sometime now, there isnt anything 
>> i can find in the docs that has helped me.  I need to take the phone 
>> number of a received SMS and find out if its in the phone book or not. 
>> If it is, the SMS will go thru, if not its going to be blocked.  How can 
>> I access the phone book without simply taking the database the contacts 
>> are in and searching each record for a string matching the senders 
>> number?  I dont what to do it that way b/c the info about the database 
>> the contacts are stored it may change or be different on some devices 
>> (creatorID, database name...).
>>
>> -- 
>>
>>
>> Scott Erickson
>> Software Engineer, FB-4, Inc.
>> [EMAIL PROTECTED]
>>
>>
>
>
> 



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

Reply via email to