Link to home
Start Free TrialLog in
Avatar of ivanh
ivanh

asked on

RasDial?????

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);
Avatar of ozo
ozo
Flag of United States of America image

I hope that's not a real password you just posted for all to see.
Avatar of ivanh
ivanh

ASKER

No it's not.  Just some jibberish.
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of ivanh

ASKER

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!
Once you have made a connection, you may have trouble authenticating unless you have installed the Dial-Up Networking 1.2 Upgrade.