Click here to Skip to main content
15,867,488 members
Articles / Mobile Apps

Pocket PC Phone Dialer

Rate me:
Please Sign up or sign in to vote.
2.16/5 (17 votes)
4 Oct 2006CPOL1 min read 63.7K   205   17   14
Pocket PC Phone Dialer

Introduction

This article explains how to make a phone dialler in eVC++ 4.0 MFC.

Making a Phone Call

All of the code you will see below are available for download. Making a call is a basic operation; we pass PhoneMakeCall, a string indicating the destination address and any options regarding whether or not we should ask for confirmation before placing the call.

ADD Header file

C++
#include <phone.h>

In Editor, go to Project>Settings

Go to Link tab

Object/Library modules: phone.lib

Adding Library

Code in MFC

C++
PHONEMAKECALLINFO mci;
LONG result;
memset(&mci, 0, sizeof(mci));
mci.cbSize = sizeof(mci);
mci.dwFlags = PMCF_DEFAULT ;
mci.pszDestAddress = TEXT("9810000000")
result=PhoneMakeCall(&mci);
if (result != 0)
{
MessageBox(_T("Error"));
}

NOTE: Put desired number in place of 9810000000.

This structure contains the information required to make a phone call.

C++
typedef struct tagPHONEMAKECALLINFO{
   DWORD cbSize;
   DWORD dwFlags;
   PCWSTR pszDestAddress;
   PCWSTR pszAppName;
   PCWSTR pszCalledParty;
   PCWSTR pszComment;
} PHONEMAKECALLINFO, * PHONEMAKECALLINFO;
Members

cbSize

The size of the PHONEMAKECALLINFO structure.

dwFlags

This member can contain either of the following values.

Value Meaning
PMCF_DEFAULT The user will not be prompted to confirm the phone call before the call is placed.
PMCF_PROMPTBEFORECALLING The user will be prompted to confirm the phone call before the call is placed.

pszDestAddress

A pointer to the phone number to be dialled. Validity of the specified address is not checked by this operation. The maximum length of the address is TAPIMAXDESTADDRESSSIZE characters, which includes the NULL terminator.

pszAppName

This parameter is reserved for future use; the value of this parameter must be set to NULL.

pszCalledParty

A pointer to the name of the party to be called. This pointer can be left NULL if the application does not wish to supply this information. The maximum length of the string is TAPIMAXCALLEDPARTYSIZE characters, which includes the NULL terminator. Longer strings are truncated.

pszComment

This parameter is reserved for future use; the value of this parameter must be set to NULL.

History

  • 4th October, 2006: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer
India India
System Programmer in InfoPro Corporation India .
Currently in the Development Team of world's one of the first Mobile Learning Management System.
Can be contacted at pradeep.kothari@yahoo.co.in

Comments and Discussions

 
Questionhow to receive call from Nokia N91 by PC Pin
pankaj motiyar10-Jul-08 18:42
pankaj motiyar10-Jul-08 18:42 
Generalis this work in mfc Pin
Paulraj G1-Jul-08 21:32
Paulraj G1-Jul-08 21:32 
Generalthe codeproject purpose Pin
YDLU4-Sep-07 10:46
YDLU4-Sep-07 10:46 
AnswerRe: the codeproject purpose Pin
Pradeep Kothari7-May-08 9:16
Pradeep Kothari7-May-08 9:16 
GeneralIncoming Phone Calls Pin
sultan_sue9-Jul-07 4:17
sultan_sue9-Jul-07 4:17 
QuestionHow to emulate an incomming call? Pin
JDBP26-May-07 10:20
JDBP26-May-07 10:20 
GeneralGood work. Pin
pkhach10-Feb-07 2:57
pkhach10-Feb-07 2:57 
Questionneeds any dll ? Pin
jsoftmonopoli12-Oct-06 4:07
jsoftmonopoli12-Oct-06 4:07 
QuestionCould this work in MFC 7.0? Pin
andre123456-Oct-06 2:23
andre123456-Oct-06 2:23 
QuestionCan anyone download this? Pin
ednrgc4-Oct-06 4:13
ednrgc4-Oct-06 4:13 
AnswerRe: Can anyone download this? Pin
Phil.Benson4-Oct-06 4:21
professionalPhil.Benson4-Oct-06 4:21 
GeneralRe: Can anyone download this? Pin
Laubi4-Oct-06 7:16
Laubi4-Oct-06 7:16 
GeneralRe: Can anyone download this? Pin
Phil.Benson4-Oct-06 21:29
professionalPhil.Benson4-Oct-06 21:29 
AnswerRe: Can anyone download this? Pin
Pradeep Kothari4-Oct-06 20:05
Pradeep Kothari4-Oct-06 20:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.