Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RASDIAL help!

Status
Not open for further replies.

sibasis

Technical User
Mar 1, 2002
94
I am using ras dial to dial into a RAS Server
However if my connection gets disconnected by anything other than using the Ras Hangup Method, the next time I dial in it gives me a Error: 756 thats a connection already dialed error !! Is there any way to clear all active connections before attempting to use the Rasdial ?


the code I am using
Dim rtn As Long
Dim b() As Byte
Dim myDialParams As VBRasDialParams
Dim lngHConn As Long
Dim strPhonebook As String

With myDialParams
.entryname = "Test"
.UserName = "testaccount"
.Password = "dummydnzpass"
.PhoneNumber = "1 345 8888888"
End With

rtn = VBRasDialParamsToBytes(myDialParams, b)

rtn = RasDial(ByVal 0&, strPhonebook, b(0), 0&, 0&, lngHConn)

thanks in advance
 
Would you care to share the solution?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
john,

No solution as such, I was not terminating the connection correctly, just terminating all RAS connections before attempting to make a new connection, I am using the RASapi32.dll now and the rashangup method. :eek:)

Public Declare Function RasHangUp Lib "rasapi32.dll" Alias "RasHangUpA" (ByVal hrasconn As Long) As Long

' hRASconn definition below:

Public Type RasConn
dwSize As Long
hrasconn As Long
szEntryName(RAS_MAXENTRYNAME) As Byte
szDeviceType(RAS_MAXDEVICETYPE) As Byte
szDeviceName(RAS_MAXDEVICENAME) As Byte
End Type

is this what you were looking for ?
 
Thank you. It's completed solutions like this that enable future users to find their answers without having to reinvent the wheel.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top