Try using the dialer helper. First, check for the existence of the dialer
helper. Second, use the helper to place the call:
Boolean DialPhone(char *pPhoneNumber, char *pDisplayName)
{
if (VerifyHelper(kHelperServiceClassIDVoiceDial,0))
return DialerHelper(pPhoneNumber,pDisplayName);
return false;
}
Boolean VerifyHelper(UInt32 serviceClassID, UInt32 helperAppID)
{
SysNotifyParamType notifyParam;
HelperNotifyEventType helperEvent;
HelperNotifyValidateType helperValidate;
MemSet(¬ifyParam,sizeof(notifyParam),0);
notifyParam.broadcaster = <your_creator_id>;
notifyParam.notifyType = sysNotifyHelperEvent;
notifyParam.notifyDetailsP = &helperEvent;
MemSet(&helperEvent,sizeof(helperEvent),0);
helperEvent.version = kHelperNotifyCurrentVersion;
helperEvent.actionCode = kHelperNotifyActionCodeValidate;
helperEvent.data.validateP = &helperValidate;
MemSet(&helperValidate,sizeof(helperValidate),0);
helperValidate.serviceClassID = serviceClassID;
helperValidate.helperAppID = helperAppID;
SysNotifyBroadcast(¬ifyParam);
return notifyParam.handled;
}
Boolean DialerHelper(char *pPhoneNumber, char *pDisplayName)
{
SysNotifyParamType notifyParam;
HelperNotifyEventType helperEvent;
HelperNotifyExecuteType helperExecute;
MemSet(¬ifyParam,sizeof(notifyParam),0);
notifyParam.notifyType = sysNotifyHelperEvent;
notifyParam.broadcaster = <your_creator_id>;
notifyParam.notifyDetailsP = &helperEvent;
MemSet(&helperEvent,sizeof(helperEvent),0);
helperEvent.version = kHelperNotifyCurrentVersion;
helperEvent.actionCode = kHelperNotifyActionCodeExecute;
helperEvent.data.executeP = &helperExecute;
MemSet(&helperExecute,sizeof(helperExecute),0);
helperExecute.serviceClassID = kHelperServiceClassIDVoiceDial;
helperExecute.dataP = pPhoneNumber;
helperExecute.displayedName = pDisplayName;
SysNotifyBroadcast(¬ifyParam);
return notifyParam.handled;
}
--------------------
Jeff Loucks
Work 425-284-1128 [EMAIL PROTECTED]
Home 253-851-8908 [EMAIL PROTECTED]
Mobile 253-691-8812
-----Original Message-----
From: Benjamin Bloomfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 12, 2005 12:22 PM
To: Palm Developer Forum
Subject: Initiating a phone call (dialing) programmatically on the Treo 600
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.
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/