Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Pocket PC Phone Dialer

0.00/5 (No votes)
4 Oct 2006 3  
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here