Click here to Skip to main content
13,199,852 members (68,815 online)
Click here to Skip to main content
Add your own
alternative version

Stats

54.3K views
174 downloads
17 bookmarked
Posted 4 Oct 2006

Pocket PC Phone Dialer

, 4 Oct 2006
Rate this:
Please Sign up or sign in to vote.
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

#include <phone.h>

In Editor, go to Project>Settings

Go to Link tab

Object/Library modules: phone.lib

Adding Library

Code in MFC

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.

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)

Share

About the Author

Pradeep Kothari
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

You may also be interested in...

Pro
Pro

Comments and Discussions

 
Questionhow to receive call from Nokia N91 by PC Pin
pankaj motiyar10-Jul-08 18:42
memberpankaj motiyar10-Jul-08 18:42 
Generalis this work in mfc Pin
gnanapaul1-Jul-08 21:32
membergnanapaul1-Jul-08 21:32 
Generalthe codeproject purpose Pin
YDLU4-Sep-07 10:46
memberYDLU4-Sep-07 10:46 
AnswerRe: the codeproject purpose Pin
Pradeep Kothari7-May-08 9:16
memberPradeep Kothari7-May-08 9:16 
GeneralIncoming Phone Calls Pin
sultan_sue9-Jul-07 4:17
membersultan_sue9-Jul-07 4:17 
QuestionHow to emulate an incomming call? Pin
JDBP26-May-07 10:20
memberJDBP26-May-07 10:20 
GeneralGood work. Pin
pkhach10-Feb-07 2:57
memberpkhach10-Feb-07 2:57 
Questionneeds any dll ? Pin
jsoftmonopoli12-Oct-06 4:07
memberjsoftmonopoli12-Oct-06 4:07 
QuestionCould this work in MFC 7.0? Pin
andre123456-Oct-06 2:23
memberandre123456-Oct-06 2:23 
QuestionCan anyone download this? Pin
edboe4-Oct-06 4:13
memberedboe4-Oct-06 4:13 
AnswerRe: Can anyone download this? Pin
Phil.Benson4-Oct-06 4:21
memberPhil.Benson4-Oct-06 4:21 
GeneralRe: Can anyone download this? Pin
Laubi4-Oct-06 7:16
memberLaubi4-Oct-06 7:16 
GeneralRe: Can anyone download this? Pin
Phil.Benson4-Oct-06 21:29
memberPhil.Benson4-Oct-06 21:29 
AnswerRe: Can anyone download this? Pin
Pradeep Kothari4-Oct-06 20:05
memberPradeep 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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 4 Oct 2006
Article Copyright 2006 by Pradeep Kothari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid