0

I am creating an app using Pocket VB.NET in VS 2008 for the Windows Mobile 6.5. I have a button on the form. When I tap the button, I want the phone to dial a pre-programmed number. How do I do that?

Venu K
  • 50
  • 8

1 Answers1

1

What about suing Windows.Mobile.Telephony namespace?

public void Talk(string number)
Member of Microsoft.WindowsMobile.Telephony.Phone

Summary:
Places the phone call, using the specified string phone number.

Parameters:
number: The phone number to dial

Just add a reference to Windows.Mobile.Telephony in your Smart Device project (targetting at least Windows Mobile 5 SDK (or 6 or higher)):

windows.mobile.telephony

Greg
  • 23,155
  • 11
  • 57
  • 79
josef
  • 5,951
  • 1
  • 13
  • 24
  • This answer works! However there is a strange quirk. If I test this code on my machine using an emulator, it throws an exception, "P/Invoke Failed." However, if I deploy it to my phone and try it, everything is in perfect order. Sometimes Microsoft does strange things! – Venu K Nov 27 '12 at 17:01
  • Did you test it on a prof. version emulator? The standard emulators do not emulate a phone. There are stdnard or premium variants of windows mobile and only the professionell versions provide the phone stuff. – josef Nov 28 '12 at 04:38
  • I think I did it on a Professional Emulator. I downloaded it from the MSDN website and it said Professional on the link. Like I said, Microsoft does some weird stuff sometimes! – Venu K Nov 28 '12 at 08:29