Solved

RasDial?????

Posted on 1998-02-26
6
314 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

920 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

16 Experts available now in Live!

Get 1:1 Help Now