|
-
Aug 9th, 2000, 02:42 AM
#1
Thread Starter
Addicted Member
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?
-
Aug 9th, 2000, 06:13 AM
#2
Member
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
-
Aug 9th, 2000, 08:11 AM
#3
Addicted Member
... and check for none listed
Code:
If ln = 0 Then
Combo1.AddItem "No Dial-Up connections found!" End If
-
Aug 9th, 2000, 09:33 AM
#4
Lively Member
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 
-
Aug 9th, 2000, 09:44 AM
#5
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|