Solved

RasDial?????

Posted on 1998-02-26
6
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 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