Results 1 to 5 of 5

Thread: Dialing the Net from NT

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111
    Can anyone tell me how to connect to the internet from Windows NT? The normal 98 code doesn't work

    Cheers

    Chris

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Use the following API's to connect, they are in wininet.dll

    Code:
    Public Declare Function InternetAutodial Lib "wininet.dll" _
    (ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
    
    
    Public Declare Function InternetAutodialHangup Lib "wininet.dll" _
    (ByVal dwReserved As Long) As Long
    
    Public Declare Function InternetGetConnectedState _
    Lib "wininet.dll" (ByRef lpSFlags As Long, _
    ByVal dwReserved As Long) As Long
    
    Public Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
    Public Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
    
    'you might have to move this code around a bit...
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0)  
    Then
        'you are connected
        End If
        'To automatically start dialling
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
            'You are connected
        End If
        'To disconnect an automatically dialled connection
        If InternetAutodialHangup(0) Then
             'you are disconnected
        endif
    the code above will automatically dial your default connection if you use the unattended code, but if you use the INTERNET_AUTODIAL_FORCE_ONLINE constant then the standard dialog will appear and will prompt you for connection.

    hth
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111
    Is there anyway of dialing a specific named connection or changing the default connection to a specific name?

  4. #4
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    I messed around with this for ages, but because there are so many differences between the API's depending upon which OS you are using, I decided to bin the idea and use the free OCX from catalyst.com (socketwrench). It handles all your dialing "stuff", and is dead easy to use, there are probably others out there, but this one worked for me. If you are really intent on using the API, there is a RAS sample on MSDN I think...

    hope this helps.
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  5. #5
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123
    Try this way:

    Public Sub ModemCallWin95_98()

    Dim WIN
    WIN = Shell("rundll32.exe rnaui.dll,RnaDial " & "Your ISP Name", 1)

    End Sub

    Public Sub ModemCallWinNT()

    Dim NT
    NT = Shell("rasphone.exe [-d Your ISP Name]", 1)

    End Sub

    -Dj4

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