The folowing is a function extracted from VBRASAPI.BAS, which I found on
MSDN.
'Description
'This module provides a simple RAS API to VB applications, based on
RASAPI16.DLL.
'All subs beginning with VBRAS may be used externally.
'VBRAS_DIAL_INFO_TYPE is the only type to be used externally.
'
'Written by Adam Ziegler CIS:72147,2221
Sub VBRASGetConnections(nConnections As Long, alhConnection() As Long,
asConnectionName() As String, nResult As Integer)
'**************************************************************************
'Purpose: returns active RAS connections
'Inputs:
'Assumes:
'Returns:
'nConnections Number of Connections (Max is
mnVBRAS_MAX_CONNECTIONS)
'alhConnection() Handles to connections (array numbers start at 1)
'asConnectionName() Name or Phone number of connections
'nResult RASAPI16 error code if non-zero
'Effects:
'**************************************************************************
Dim nLoopCount As Integer
Static aRASCONN(1 To mnVBRAS_MAX_CONNECTIONS) As RASCONN
Dim lBufferSize As Long
'RASAPI16 requires first element must hold size of buffer array
lBufferSize = mnVBRAS_MAX_CONNECTIONS * Len(aRASCONN(1))
aRASCONN(1).dwSize = Len(aRASCONN(1))
nResult = RasEnumConnections(aRASCONN(1), lBufferSize, nConnections)
If nConnections > 0 Then
ReDim alhConnection(nConnections)
ReDim asConnectionName(nConnections)
For nLoopCount = 1 To nConnections
alhConnection(nLoopCount) = aRASCONN(nLoopCount).hrasconn
asConnectionName(nLoopCount) = aRASCONN(nLoopCount).szEntryName
Next
End If
End Sub
The functions and declarations in the file allowed me to build a RAS aware
Application.
If you can't find the file, mail me, and I will send you a copy.
--
Steve Wort