Results 1 to 5 of 5

Thread: List Dialup Networking Connections?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    225

    Question

    I am trying to create a list box that contains all the Dialup Connections listed in the Dial-Up Netorking folder. Is there an easy/quick way to accomplish this?

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    60
    The code below enumerates all of the dial up networking connections on the system and outputs them to a combobox (combo1):

    --Module Code--


    Public Declare Function RasEnumEntries Lib "RasApi32.dll" Alias "RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long

    Public Const RAS95_MaxEntryName = 256

    Public Type RASENTRYNAME95
    dwsize As Long
    szentryname(RAS95_MaxEntryName) As Byte
    End Type


    --Form Code--

    Dim s As Long, l As Long, ln As Long, a$
    ReDim R(255) As RASENTRYNAME95

    R(0).dwsize = 264
    s = 256 * R(0).dwsize
    l = RasEnumEntries(vbNullString, vbNullString, R(0), s, ln)
    For l = 0 To ln - 1
    a$ = StrConv(R(l).szentryname(), vbUnicode)
    Combo1.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
    Next



    Hope this helps you,
    Grant French
    -----------------------------------------------
    E-Mail: [email protected]
    ICQ: 33122184

  3. #3
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    ... and check for none listed
    Code:
    If ln = 0 Then
            Combo1.AddItem "No Dial-Up connections found!"    End If

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    Thanks gfrench and Steven McGarva, I posted this question about 2 weeks ago, although I just got a link to some non-free activeX controls, so thanks to ssrp for posting it again!
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  5. #5
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Unhappy Ras, DUN, vs W95/98/NT/2000

    If you guys are playing with DUN and the like you might have fun implementing all the API stuff on different platforms, cause some of the implementations have a different syntax... I went and got the socketwrench stuff from catalyst.com. Its free and saved me a lot of hassle. I have some classes and stuff if anyone really wants to get their hands dirty, just mail me and lemme know

    Cya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width