Programmatically Create Dialup Connection Objects
Posted
by Jordi Mas
on January 30th, 2000
Environment: This code has been successfully tested under Windows 9x and Windows NT

CRasAbsLay
CRasAbsLay is a simple class that encapsulates the functionality that you need from RAS to be able to create dialup connections in your Dialup connection folder. You cannot assume that all the machines have the RAS services available and you cannot link the RAS API library statically to your application, that's the reason why use the object CRas instead of calling the API directly.I wrote this class when I wrote a installation program from an ISP that setup your Dialup Network with their connection settings.
Integrating the Code in Your Application
- Add RasAbsLay.cpp and RasAbsLay.h to your project
- If you are not already including afxtempl.h, add it to your stdafx.h file
- Call CreatePhoneBookEntry member to create your connection

Comments
Need a small help[ windows 98/95]
Posted by Legacy on 01/23/2004 12:00amOriginally posted by: Big D
Thank you very much Jordi Mas...
Need a small help.I hv created a com using ur code, tested in xp,2k prof. While testing in windows 98,i encountered a error in setting SetEntryProperties.
Is there any specific RASENTRY parameter settings for windows 98 ? I also need to use it in windows 95.
Thanx again for goin through my request. I mm tryin to find the problem.
Expecting ur comment on this.
Regards,
Big D
ReplyProblem with setting Login/Password under NT
Posted by Legacy on 06/29/2003 12:00amOriginally posted by: Alexander McCooke
I am trying to use RasSetEntryDialParams() to specify a user name and password so the user won't be prompted when they dial. This works as expected under Windows NT SP6a and Windows 2000, but under NT SP3, SP4 and SP5 this function call does not appear to do anything - the standard user name/password dialog appears with the user name defaulting to the user's NT user name (not the one I specified in the function call).
Does anyone know of a workaround?
Another curious "feature" - when creating a phonebook entry under Windows 95, setting RASEO_TerminalAfterDial brings up a terminal windows *before* dialing and RASEO_TerminalBeforeDial brings up a window *afterwards*. Works as expected under Windows NT.
Replyand unicode
Posted by Legacy on 03/26/2003 12:00amOriginally posted by: baroukh
are you testing your code in unicode
Replysimple question with country-code
Posted by Legacy on 03/06/2003 12:00amOriginally posted by: claude bisdorff
Hello, I have just a little question with the CreatePhoneBookentry-Function.
You set rasEntry.CountryCode=34
In fact, is this the national prefix that will be set?
If I dont want to set a national prefix, can I leave this line away?WIll the connection still work?
Thanx a lot
Claude Bisdorff
ReplyI need a VB way
Posted by Legacy on 05/23/2002 12:00amOriginally posted by: Osama
I am VB and Delphi Programmer and I need a way to do what is done here with in the environments I work proffesionally on it
Replyn/a
Posted by Legacy on 05/08/2002 12:00amOriginally posted by: Paul
Excellent work!
Finally someone has been so nice as to reveal Microsofts secrets in DUN. Trying to keep the default dialogs silent has long been one of my needs.
Now if I can just figure out how to port stdafx.h to C++ Builder I'm set.
Peace out~
ReplyPaul
Ontario,Canada
How to use the whole code in MS Visual C++???
Posted by Legacy on 03/28/2002 12:00amOriginally posted by: Peter Young
Hi,
I just downloaded that code. How do I just grab whats there and make it a self-executable file. I can't for the life of me figure it out in visual c++.
Just want to change the ip addresses and add a phone number. Then just make it an exe.
Thanks for any help,
[ stingray ]
ReplyRasSetEntryProperties returns 632
Posted by Legacy on 02/20/2002 12:00amOriginally posted by: Lau
Hi,
I downloaded and compiled the sample. When I tried to create a new dial up connection, it said "unable to create..." and RasSetEntryProperties() returned an error code 632. The PhoneEntry sample in SDK runs fine though. Please help. Thanks
ReplyHow to I add static dial-up IP address to this app.?
Posted by Legacy on 12/27/2001 12:00amOriginally posted by: BUGRA GUMUS
ReplyHow do I run this connection from my applikation?
Posted by Legacy on 07/30/2000 12:00amOriginally posted by: Ferdinando
How can I run the Dialup Connection in my App automaticly?
I found out, that the connection is registerd in:
HKEY_CURRENT_USER\RemoteAccess\Addresses
but I don�t know where the file is to find and how to start it in my VC-App.
The second question is: After starting the Dialup connection automaticly the user must click ok. How can I "click" the ok button automaticly in my app, or how can I send the OnOK Message to the connection?
Perhaps there is an easier way to start this connection without open it regulary?
Reply