try to use dialing using notofications,it worked for me on tungsten t5
bool DialPhone(char *number, char *displayedName)
{
SysNotifyParamType param;
HelperNotifyEventType details;
HelperNotifyExecuteType execute;
Err err;
bool ok;
MemSet(¶m,sizeof(SysNotifyParamType),0);
param.notifyType = sysNotifyHelperEvent;
param.broadcaster = appFileCreator;
param.notifyDetailsP = &details;
param.handled = false;
MemSet(&details,sizeof(HelperNotifyEventType),0);
details.version = kHelperNotifyCurrentVersion;
details.actionCode = kHelperNotifyActionCodeExecute;
details.data.executeP = &execute;
MemSet(&execute,sizeof(HelperNotifyExecuteType),0);
execute.serviceClassID = kHelperServiceClassIDVoiceDial;
execute.dataP = number;
execute.displayedName = displayedName;
err=SysNotifyBroadcast(¶m);
ok=((err==0) && param.handled);
return ok;
}
Benjamin Bloomfield wrote:
> Hi,
>
> I need to dial a number on the Treo 600, and it doesn't seem to be working.
> It causes a crash, and according to the system log, the application causing
> the crash was "Phone", and not my own application.
>
> Anyway, here's the code I'm using to initiate the call:
>
> Wait -- one more thing: everything works, if I set confirm to true, or copy
> the values for name and number from string constants.
>
> Here's the code:
>
> static void LaunchPhone(char* number, char* name, bool confirm) {
> PhoneAppLaunchCmdDialType* dial; UInt16 len; dial =
> (PhoneAppLaunchCmdDialType *) MemPtrNew(sizeof(PhoneAppLaunchCmdDialType));
> dial->version = 1; dial->confirm = confirm; len = StrLen(name); dial->name =
> (char*)MemPtrNew(len+1); StrCopy(dial->name, name); len = StrLen(number);
> dial->number = (char*)MemPtrNew(len+1); StrCopy(dial->number, number);
> dial->failLaunchCreator = appFileCreator; dial->failLaunchCode =
> sysAppLaunchCmdNormalLaunch; dial->dialMethod = PhoneAppDialMethodNormal;
> MemPtrSetOwner((MemPtr)dial, 0); MemPtrSetOwner((MemPtr)dial->name, 0);
> MemPtrSetOwner((MemPtr)dial->number, 0);
> LaunchWithCommand(sysFileTApplication, hsFileCPhone, phoneAppLaunchCmdDial,
> dial); }
>
> Thanks.
>
> -Benjamin Bloomfield
>
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/