Solved

RasDial?????

Posted on 1998-02-26
6
302 Views
Last Modified: 2008-02-01
I'm trying to get this to work, but cannot.  The
code is below.  What am I doing wrong?  I'm trying
to do this on a Win95 box.

      RASDIALPARAMS RasParams;
      HRASCONN* hRasConnection = NULL;
      DWORD ret;

      strcpy(RasParams.szEntryName, "Aracnet");
      strcpy(RasParams.szPhoneNumber, "696-7095");
      strcpy(RasParams.szUserName, "ivanh");
      strcpy(RasParams.szPassword, "Ainonth0");
      RasParams.dwSize = sizeof (RASDIALPARAMS);

      ret = RasDial(NULL, NULL, &RasParams, NULL, NULL, hRasConnection);
0
Comment
Question by:ivanh
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1182860
I hope that's not a real password you just posted for all to see.
0
 
LVL 1

Author Comment

by:ivanh
ID: 1182861
No it's not.  Just some jibberish.
0
 
LVL 32

Accepted Solution

by:
jhance earned 150 total points
ID: 1182862
     RASDIALPARAMS rdParams;
      HRASCONN hRasConn;

      rdParams.dwSize = sizeof(RASDIALPARAMS);
      strcpy(rdParams.szEntryName, "Bysnet");
      strcpy(rdParams.szPhoneNumber, "");
      strcpy(rdParams.szCallbackNumber, "");
      strcpy(rdParams.szUserName, "name");
      strcpy(rdParams.szPassword, "password");
      strcpy(rdParams.szDomain, "");

      DWORD result = RasDial(NULL, NULL, &rdParams, NULL, NULL, &hRasConn);
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 32

Expert Comment

by:jhance
ID: 1182863
Two things:

1) You not settings all of the RASDIALPARAMS entries.  I don't know for sure which ones are not needed so I fill them all out.

2) You are not providing an HRASCONN for the connection result.  You are declaring a (HRASCONN *).  I think this is why your call is failing.
0
 
LVL 1

Author Comment

by:ivanh
ID: 1182864
Thanks, that was it!  Ya, all it did was declare a pointer
to HRASCONN.  I think I was under the asumption that
the function would provide me with the structure instead
of having to create and pass the whole structure for it
to fill.  

This is great!  This internet connect stuff on Windows is
a snap!

By the way, I was reading the docs on RASDIALPARAMS and it said
all I really need is the szEntryName as long as the connection
already exists in the Dialup Network folder (registry entry).
The others are override parameters or manual entry points.

Thanks again!
0
 

Expert Comment

by:ljadams
ID: 1182865
Once you have made a connection, you may have trouble authenticating unless you have installed the Dial-Up Networking 1.2 Upgrade.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now