all this is on Treo650 (unlocked GSM)

from palmone sdk i found i should use notification call for it...
its in HsAppLaunchCmd.h

so i wrote this function - it should start nrew record view and prefill number 
fro mobile phone

Boolean PimNewContact(char *number)
{
    AddrCreateNewRecordParamsType *params;
    SysNotifyParamType *notify;
    Boolean ok;

    ok=false;
    params=(AddrCreateNewRecordParamsType 
*)MemPtrNew(sizeof(AddrCreateNewRecordParamsType));
    if(params)
    {
        MemPtrSetOwner(params,0);
        MemSet(params,sizeof(AddrCreateNewRecordParamsType),0);

        params->field=5;//kAddrDBRecMobileFld;
        params->data=(char *)MemPtrNew(StrLen(number)+1);
        if(params->data)
        {
            MemPtrSetOwner(params->data,0);
            StrCopy(params->data,number);

            notify=(SysNotifyParamType *)MemPtrNew(sizeof(SysNotifyParamType));
            if(notify)
            {
                MemPtrSetOwner(notify,0);
                MemSet(notify,sizeof(SysNotifyParamType),0);
                notify->notifyType=addrAppNotificationCreateNewRecord;
                notify->notifyDetailsP=&params;

                
CallWithCommand(sysFileTApplication,kPalmOneCreatorIDContacts,sysAppLaunchCmdNotify,notify);
                ok=true;
            }
        }
    }
    return(ok);
}

problem is that this function does nothing. so i replaced CallWithCommand with 
LaunchWithCommand. Then i get crash all the time and debugprefs application 
tells me that crashed application was Contacts and message is 'Non-word-aligned 
handle'

does anyone has any idea what i am doing wrong?

thanks...

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

Reply via email to