Solved

RasDial?????

Posted on 1998-02-26
6
329 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

830 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