EnumRasEntries 
Author Message
 EnumRasEntries

Sorry if this is obvious, it isn't too me!

How do I pass the array to this call successfully. If there is anything you
suggest I should read anywhere that will help me with this I will stop
pestering you all and try it!

Thanks

Jamie Chapman.



Sun, 16 Jul 2000 03:00:00 GMT  
 EnumRasEntries



Quote:
>How do I pass the array to this call successfully. If there is anything you
>suggest I should read anywhere that will help me with this I will stop
>pestering you all and try it!

Do a search on the MS website for the VB32RAS.EXE sample
-sm


Mon, 17 Jul 2000 03:00:00 GMT  
 EnumRasEntries

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



Tue, 18 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem with EnumRasEntries (RASAPI32.DLL) and VB6.

2. Problem with EnumRasEntries (RASAPI32.DLL) and VB6.

3. Problem with EnumRasEntries (RASAPI32.DLL) and VB6.

 

 
Powered by phpBB® Forum Software