Programmatically Create Dialup Connection Objects

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

  1. Add  RasAbsLay.cpp and RasAbsLay.h to your project
  2. If you are not already including afxtempl.h, add it to your stdafx.h file
  3. Call CreatePhoneBookEntry member to create your connection

The Demo Project

The example code is a dialog-based application that prompts the user for information regarding its connection and creates the proper dial-up settings.

Downloads

Download demo project - 15 Kb


Comments

  • Need a small help[ windows 98/95]

    Posted by Legacy on 01/23/2004 12:00am

    Originally 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

    Reply
  • Problem with setting Login/Password under NT

    Posted by Legacy on 06/29/2003 12:00am

    Originally 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.

    Reply
  • and unicode

    Posted by Legacy on 03/26/2003 12:00am

    Originally posted by: baroukh

    are you testing your code in unicode

    Reply
  • simple question with country-code

    Posted by Legacy on 03/06/2003 12:00am

    Originally 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

    Reply
  • I need a VB way

    Posted by Legacy on 05/23/2002 12:00am

    Originally 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

    Reply
  • n/a

    Posted by Legacy on 05/08/2002 12:00am

    Originally 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~
    Paul
    Ontario,Canada

    Reply
  • How to use the whole code in MS Visual C++???

    Posted by Legacy on 03/28/2002 12:00am

    Originally 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 ]

    Reply
  • RasSetEntryProperties returns 632

    Posted by Legacy on 02/20/2002 12:00am

    Originally 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

    Reply
  • How to I add static dial-up IP address to this app.?

    Posted by Legacy on 12/27/2001 12:00am

    Originally posted by: BUGRA GUMUS

    I wanna create a dial-up connection but my ISP will not assign an IP address automaticly ; I will write IP address assigned to me staticly to my dial-up client.
    
    

    So by using this program how I handle this?

    Thanks

    Reply
  • How do I run this connection from my applikation?

    Posted by Legacy on 07/30/2000 12:00am

    Originally 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
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

  • As mobile devices have pushed their way into the enterprise, they have brought cloud apps along with them. This app explosion means account passwords are multiplying, which exposes corporate data and leads to help desk calls from frustrated users. This paper will discover how IT can improve user productivity, gain visibility and control over SaaS and mobile apps, and stop password sprawl. Download this white paper to learn: How you can leverage your existing AD to manage app access. Key capabilities to …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds