RasDial() howto
-
I'm trying to use RasDial to connect through a modem to a network my code:
RASDIALPARAMS rdParams; rdParams.dwSize = sizeof(RASDIALPARAMS); rdParams.szEntryName\[0\] = '\\0'; lstrcpy(rdParams.szPhoneNumber, strPhoneNr); rdParams.szCallbackNumber\[0\] = '\\0'; lstrcpy( rdParams.szUserName, strUserNr); lstrcpy( rdParams.szPassword, strPassword); rdParams.szDomain\[0\] = '\\0'; HRASCONN hRasConn = NULL; dwRet = RasDial( NULL, NULL, &rdParams, NULL, NULL, &hRasConn );
The RasDial call results in a XP bluescreen. Anybody ever got this error? What should i check for? Thanks
-
I'm trying to use RasDial to connect through a modem to a network my code:
RASDIALPARAMS rdParams; rdParams.dwSize = sizeof(RASDIALPARAMS); rdParams.szEntryName\[0\] = '\\0'; lstrcpy(rdParams.szPhoneNumber, strPhoneNr); rdParams.szCallbackNumber\[0\] = '\\0'; lstrcpy( rdParams.szUserName, strUserNr); lstrcpy( rdParams.szPassword, strPassword); rdParams.szDomain\[0\] = '\\0'; HRASCONN hRasConn = NULL; dwRet = RasDial( NULL, NULL, &rdParams, NULL, NULL, &hRasConn );
The RasDial call results in a XP bluescreen. Anybody ever got this error? What should i check for? Thanks
eusto wrote:
The RasDial call results in a XP bluescreen.
Does this mean that
RasDial()
is not returning?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
eusto wrote:
The RasDial call results in a XP bluescreen.
Does this mean that
RasDial()
is not returning?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
Yes, it is not returning. My whole computer dies. The fix for me is to use the phone book feature of windows:
RASDIALPARAMS rdParams; rdParams.dwSize = sizeof(RASDIALPARAMS); //set the szEntryName to an already defined connection lstrcpy(rdParams.szEntryName,strPredefinedConnectionName); //not using these features because they're already defined in that connection rdParams.szPhoneNumber\[0\] = 0; rdParams.szPhoneNumber\[0\] = 0; rdParams.szUserName\[0\] = 0; rdParams.szPassword\[0\] = 0; rdParams.szCallbackNumber\[0\] = '\\0'; rdParams.szDomain\[0\] = '\\0'; HRASCONN hRasConn = NULL; dwRet = RasDial( NULL, "C:\\\\Documents and Settings\\\\" "All Users\\\\Application Data\\\\" "Microsoft\\\\Network\\\\Connections\\\\Pbk\\\\rasphone.pbk", //the system path to the phone book &rdParams, NULL, NULL, &hRasConn );
It's a bit frustrating that i can't use this to work with "on the fly" dialup connections. The windows blue screen really scares me :sigh:
-
Yes, it is not returning. My whole computer dies. The fix for me is to use the phone book feature of windows:
RASDIALPARAMS rdParams; rdParams.dwSize = sizeof(RASDIALPARAMS); //set the szEntryName to an already defined connection lstrcpy(rdParams.szEntryName,strPredefinedConnectionName); //not using these features because they're already defined in that connection rdParams.szPhoneNumber\[0\] = 0; rdParams.szPhoneNumber\[0\] = 0; rdParams.szUserName\[0\] = 0; rdParams.szPassword\[0\] = 0; rdParams.szCallbackNumber\[0\] = '\\0'; rdParams.szDomain\[0\] = '\\0'; HRASCONN hRasConn = NULL; dwRet = RasDial( NULL, "C:\\\\Documents and Settings\\\\" "All Users\\\\Application Data\\\\" "Microsoft\\\\Network\\\\Connections\\\\Pbk\\\\rasphone.pbk", //the system path to the phone book &rdParams, NULL, NULL, &hRasConn );
It's a bit frustrating that i can't use this to work with "on the fly" dialup connections. The windows blue screen really scares me :sigh:
So the only difference is the second argument? MSDN states that if this parameter is
NULL
, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box. Do you have this set up?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
So the only difference is the second argument? MSDN states that if this parameter is
NULL
, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box. Do you have this set up?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
The difference is in the way i specify the connection to use. I'm telling RasDial to use the strPredefinedConnectionName (ex: a connection named MyDialup that appears in network connections) from the specified phone book. I've read that in MSDN also but i couldn't find the dialog for this setting. Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
-
The difference is in the way i specify the connection to use. I'm telling RasDial to use the strPredefinedConnectionName (ex: a connection named MyDialup that appears in network connections) from the specified phone book. I've read that in MSDN also but i couldn't find the dialog for this setting. Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
eusto wrote:
Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
I would hope not. The BSOD is when Windows has gotten really angry and something totally unexpected has happened in some code. Telling Windows to use a file that does not exist should simply result in a normal "error" message box (i.e., failing gracefully). I'm sorry I do not have any better suggestions.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
eusto wrote:
Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
I would hope not. The BSOD is when Windows has gotten really angry and something totally unexpected has happened in some code. Telling Windows to use a file that does not exist should simply result in a normal "error" message box (i.e., failing gracefully). I'm sorry I do not have any better suggestions.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch