Question

I called "Rasphone.exe" from my C code using "ShellExecuteEx" to create a dial-up connection. I found different behaviour on Windows XP and Windows 7.

Behavior in Windows XP : The RASDial connection gets created without any Pop-up Window.

Behaviour in Windows 7 : A DialUp window Pops up asking number to be dialed. I didnt enter any number, and clicked "Dial" button. Connection gets connected. The below is the snap-shot window which I get in windows 7?

enter image description here

What is the reason for the difference in behaviour?

Was it helpful?

Solution

What is the reason for the difference in behaviour?

Windows 7 is a different operating system than Windows XP. Before Metro was invented, the Windows team didn't have anything to do, so they sat around changing a bunch of old code just to see if anyone noticed. Looks like you've found one of the things they changed.

No worries, though. The code you had was doomed in the first place. The proper way to dial a network connection is not to launch the network dialer application, it's to call the API provided for this purpose.

The name of the API you want is WinINet, and you'll find the documentation for it here. In particular, you'll be interested in the Establishing a Dial-Up Connection to the Internet section, which mentions the InternetDial function.

Of course, they've changed this, too. Starting with Windows Vista, this function uses the RAS API internally to establish the connection. Skip the middle man by calling the RasDial or RasDialDlg functions directly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top