Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB5?-Call dialup for internet connection

Posted on 1999-06-30
9
Medium Priority
?
167 Views
Last Modified: 2010-05-02
How do you call the dialup to start a internet connection from code?
0
Comment
Question by:LeeGar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 3

Expert Comment

by:KhollAD
ID: 1521199
The Shell way :

Dim res
res = Shell("rundll32.exe rnaui.dll,RnaDial MyConnectionName", vbNormalFocus)

0
 

Author Comment

by:LeeGar
ID: 1521200
Great! But now how do I present  to the user all the available dialups the user can select- just before running that code for the one they select? This is assuming there is more that 1 dialup connection in win95.
0
 

Author Comment

by:LeeGar
ID: 1521201
Great! But now how do I present  to the user all the available dialups the user can select- just before running that code for the one they select? This is assuming there is more that 1 dialup connection in win95.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:LeeGar
ID: 1521202
Great! But now how do I present  to the user all the available dialups the user can select- just before running that code for the one they select? This is assuming there is more that 1 dialup connection in win95.
0
 
LVL 2

Expert Comment

by:mannen
ID: 1521203
you can find them in the registry
0
 

Author Comment

by:LeeGar
ID: 1521204
do you have a path in the registry that points to this?
0
 
LVL 3

Accepted Solution

by:
KhollAD earned 80 total points
ID: 1521205
Hi LeeGar,

 The complete solution :


Private Declare Function RasEnumEntries Lib "RasApi32.dll" Alias "RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasenumparams As Any, lpcb As Long, lpcentries As Long) As Long

Private Const RAS_MAXENTRYNAME As Integer = 256

Private Type RasEntryName
    dwSize As Long
    szEntryName(RAS_MAXENTRYNAME) As Byte
End Type



Private Sub Command1_Click()

Dim htemp As Long
Dim tt As RasEntryName
Dim lpcb As Long
Dim lpcentries As Long
Dim i As Integer
Dim en As String
Dim FIND As Boolean
Dim Ret As Long

List1.Clear


tt.dwSize = 26
lpcb = RAS_MAXENTRYNAME * tt.dwSize
lpcentries = 0
Ret = RasEnumEntries(vbNullString, vbNullString, tt, lpcb, lpcentries)

For i = 0 To RAS_MAXENTRYNAME - 1
    If tt.szEntryName(i) > 31 Then
        FIND = True
        en = en & Chr(tt.szEntryName(i))
    End If
    If tt.szEntryName(i) = 0 And FIND = True Then
        FIND = False
        List1.AddItem Trim(en)
        en = ""
    End If
Next

End Sub

Private Sub List1_DblClick()

Dim res
res = Shell("rundll32.exe rnaui.dll,RnaDial " & List1.List(List1.ListIndex), vbNormalFocus)

End Sub

0
 

Author Comment

by:LeeGar
ID: 1521206
Nice! But I didn't understand a few things.

Private Const RAS_MAXENTRYNAME As Integer = 256

Private Type RasEntryName
         dwSize As Long
         szEntryName(RAS_MAXENTRYNAME) As Byte
 End Type

 
  Dim tt As RasEntryName
  tt.dwSize = 26
  lpcb = RAS_MAXENTRYNAME * tt.dwSize

so this checks the registry for names up to 256 characters?
What was the dwsize for at 26 and
the purpose of lpcb being at 6656? Thanks!
0
 

Author Comment

by:LeeGar
ID: 1521207
Thanks KhollAD, works like a charm! Hope to hear from you in future posts.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question