Error Handling in Dialup Network

I Want to Know Status the and Error Message While I am using DialUp Network. I am using the following code for Dialup Network. Here I want to know
(1) How can i know the Status of the connection
(2) Need to handle any error during connection

Code is given below
===================

Private Sub Command1_Click()
    Dim DialUp
    DialUp = "My Connection"
    DialUp = Shell("rundll32.exe rnaui.dll,RnaDial " & DialUp, 1)
End Sub

Private Sub Timer1_Timer()
  Here I want to know the Status and Error for Every 10 Sec
End Sub

--  I want to Know the Status of the Dialup Network for Every 10 Seconds by Timer Control. But the above code doesn't give any error msg while No Dial tone and disconnected.

  Exactly i need to check the Status like Dialing, No Dialtone, Disconnected etc for Every 10 Sec.


thangarajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cantrellCommented:
You can only check to see if you're connected or not, since your shelling out to the Windows dialer and the Windows dialer handles all of this. The only way to detect dial tone is to write your own dial up connection, since this is all handled by the windows dialer and since your shelling out to it, it cannot return anything to you other than if it shelled out, or opened correctly. You can however, check to see if your connected by putting this in your 'Timer'... Then, after a certain period of time (say 1 minute), if you're not connected, you can assume that you're not going to get connected, and do whatever you want at that point (like throw up a error connecting msgbox).

Public Function Connected_To_ISP() As Boolean

   Dim Hkey As Long
    Dim lpSubKey As String
    Dim phkResult As Long
    Dim lpValueName As String
    Dim lpReserved As Long
    Dim lpType As Long
    Dim lpData As Long
    Dim lpcbData As Long
    Connected_To_ISP = False
    lpSubKey = "System\CurrentControlSet\Services\RemoteAccess"
    ReturnCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_ALL_ACCESS, phkResult)
   

    If ReturnCode = ERROR_SUCCESS Then
        Hkey = phkResult
        lpValueName = "Remote Connection"
        lpReserved = APINULL
        lpType = APINULL
        lpData = APINULL
        lpcbData = APINULL
        ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, ByVal lpData, lpcbData)
       
        lpcbData = Len(lpData)
        ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, lpData, lpcbData)

        If ReturnCode = ERROR_SUCCESS Then

            If lpData = 0 Then
                '     ' Not Connected
            Else
                '     ' Connected
                Connected_To_ISP = True
            End If

            End If

                RegCloseKey (Hkey)
            End If

End Function

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cantrellCommented:
Oh, and by the way - you can also use this before you start the dial up connection, to see if you are already connected, and then determine if you even need to start the DUN connection.
0
cantrellCommented:
I did find out that you can check the modems responses... See this article on exactly how.

http://support.microsoft.com/support/kb/articles/Q250/6/48.ASP
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

thangarajAuthor Commented:
The following are the Code I am using right now. But I am gettin error even i have connected.

Code
====
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long         ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long

Public Function Connected_To_ISP() As Boolean

    Dim hKey As Long
    Dim lpSubKey As String
    Dim phkResult As Long
    Dim lpValueName As String
    Dim lpReserved As Long
    Dim lpType As Long
    Dim lpData As Long
    Dim lpcbData As Long
    Connected_To_ISP = False
    lpSubKey = "System\CurrentControlSet\Services\RemoteAccess"
    ReturnCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_ALL_ACCESS, phkResult)
     

    If ReturnCode = ERROR_SUCCESS Then
        hKey = phkResult
        lpValueName = "My Connection"
        'lpValueName = "Remote Connection"
        lpReserved = APINULL
        lpType = APINULL
        lpData = APINULL
        lpcbData = APINULL
        ReturnCode = RegQueryValueEx(hKey, lpValueName, lpReserved, lpType, ByVal lpData, lpcbData)
         
        lpcbData = Len(lpData)
        ReturnCode = RegQueryValueEx(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData)

        If ReturnCode = ERROR_SUCCESS Then
            If lpData = 0 Then
                Connected_To_ISP = False
                '     ' Not Connected
            Else
                '     ' Connected
                Connected_To_ISP = True
            End If

            End If

                RegCloseKey (hKey)
            End If

End Function

Private Sub Timer1_Timer()
    If Connected_To_ISP = True Then
        MsgBox "Success"
    Else
        MsgBox "Error"
    End If
End Sub

Any Solution ??????????
0
cantrellCommented:
I don't know what happened, but the code I posted, I just check and it worked fine. However, I copied and pasted your code listed above and it didn't.

Do this.

Copy this funcion....
Public Function Connected_To_ISP() As Boolean

    Dim Hkey As Long
    Dim lpSubKey As String
    Dim phkResult As Long
    Dim lpValueName As String
    Dim lpReserved As Long
    Dim lpType As Long
    Dim lpData As Long
    Dim lpcbData As Long
    Connected_To_ISP = False
    lpSubKey = "System\CurrentControlSet\Services\RemoteAccess"
    ReturnCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_ALL_ACCESS, phkResult)
   

    If ReturnCode = ERROR_SUCCESS Then
        Hkey = phkResult
        lpValueName = "Remote Connection"
        lpReserved = APINULL
        lpType = APINULL
        lpData = APINULL
        lpcbData = APINULL
        ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, ByVal lpData, lpcbData)
       
        lpcbData = Len(lpData)
        ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, lpData, lpcbData)

        If ReturnCode = ERROR_SUCCESS Then

            If lpData = 0 Then
                '     ' Not Connected
            Else
                '     ' Connected
                Connected_To_ISP = True
            End If

            End If

                RegCloseKey (Hkey)
            End If

--------------------
Now, copy this into a *seperate* .bas module, then try it.

Option Explicit

'Registry Functions.
Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long
Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal Hkey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As typSECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal Hkey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal ReturnedRegValue As String, ByVal cbData As Long) As Long
Declare Function RegConnectRegistry Lib "advapi32.dll" Alias "RegConnectRegistryA" (ByVal lpMachineName As String, ByVal Hkey As Long, phkResult As Long) As Long
Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal Hkey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal ReturnedRegValue As String, ByVal cbData As Long) As Long
Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As Long
Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As Long) As Long
Declare Function RegQueryValueExString Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal ReturnedRegValue As String, lpcbData As Long) As Long
Declare Function RegDeleteKey& Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String)
Declare Function RegDeleteValue& Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal Hkey As Long, ByVal lpSubKey As String)
Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal Hkey As Long, ByVal dwIndex As Long, ByVal lpname As String, cbName As Long) As Long
Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal Hkey As Long, ByVal dwIndex As Long, ByVal lpname As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As FILETIME) As Long
Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal Hkey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, lpReserved As Long, lpType As Long, lpData As Byte, lpcbData As Long) As Long
'Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long

'Drive information.
Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long



'For form position
Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_SHOWWINDOW& = &H40
Public Const HWND_BOTTOM& = 1

 
'Security Mask constants
Public Const READ_CONTROL = &H20000
Public Const SYNCHRONIZE = &H100000
Public Const STANDARD_RIGHTS_ALL = &H1F0000
Public Const STANDARD_RIGHTS_READ = READ_CONTROL
Public Const STANDARD_RIGHTS_WRITE = READ_CONTROL
Public Const KEY_QUERY_VALUE = &H1
Public Const KEY_SET_VALUE = &H2
Public Const KEY_CREATE_SUB_KEY = &H4
Public Const KEY_ENUMERATE_SUB_KEYS = &H8
Public Const KEY_NOTIFY = &H10
Public Const KEY_CREATE_LINK = &H20
Public Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))
Public Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE))
Public Const KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE))
Public Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))

'Predefined Registry Keys used in hKey Argument
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004

' Return codes from Registration functions.
Public Const ERROR_SUCCESS = 0&
Public Const ERROR_BADDB = 1009&
Public Const ERROR_BADKEY = 1010&
Public Const ERROR_CANTOPEN = 1011&
Public Const ERROR_CANTREAD = 1012&
Public Const ERROR_CANTWRITE = 1013&
Public Const ERROR_OUTOFMEMORY = 14&
Public Const ERROR_INVALID_PARAMETER = 87&
Public Const ERROR_ACCESS_DENIED = 5&

'Data type Public Constants
Public Const REG_NONE = 0
Public Const REG_SZ = 1
Public Const REG_EXPAND_SZ = 2
Public Const REG_BINARY = 3
Public Const REG_DWORD = 4
Public Const REG_DWORD_LITTLE_ENDIAN = 4
Public Const REG_DWORD_BIG_ENDIAN = 5
Public Const REG_LINK = 6
Public Const REG_MULTI_SZ = 7
Public Const REG_RESOURCE_LIST = 8
Public Const REG_FULL_RESOURCE_DESCRIPTOR = 9
Public Const REG_RESOURCE_REQUIREMENTS_LIST = 10

'for regenumvalue's modified key time.
Public Type FILETIME
   dwLowDateTime As Long
   dwHighDateTime As Long
End Type

'Options
Public Const REG_OPTION_NON_VOLATILE = 0&
Public Const REG_OPTION_VOLATILE = &H1

Type typSECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Variant
  bInheritHandle As Long
End Type

Public Sub UpdateRegistry2(Hkey As Long, KeyToChange As String, NewValue As String, NameValue As String)

      Dim keyhandle As Long          'To hold the KeyHandle number returned by opening the Registry key.
      Dim dataSize As Long           'Size of the Data (string) we are changing (including the terminating /0).
      Dim ReturnCode As Long         'Holds the return code of the process (i.e. if there was an error).
      Dim ReturnedRegValue As String

        'Open the Registry Key.
     ReturnCode = RegOpenKeyEx(Hkey, KeyToChange, 0, KEY_ALL_ACCESS, keyhandle)
          'If we can't open the key then it's not there so we need to create it.
          If ReturnCode <> 0 Then ReturnCode = RegCreateKey(Hkey, KeyToChange, keyhandle)
      If ReturnCode <> 0 Then MsgBox "Error Updating Registry", vbCritical, "UpdateRegistry2 Module": Exit Sub
     
        'Change the Registry Key.
      ReturnCode = RegSetValueEx(keyhandle, NameValue, 0, REG_SZ, NewValue, Len(KeyToChange) + 1)
          'Check for error
        If ReturnCode <> 0 Then MsgBox "Error Updating Registry", vbCritical, "UpdateRegistry2 Module": Exit Sub

        'Close the Registry Key.
     ReturnCode = RegCloseKey(keyhandle)
End Sub

Public Sub gAPIDisplayError(Code&, Optional keyhandle As Long, Optional keyname As String)


                                        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        '' Perform a Select routine on Code&, and issue the respective error message ''
                                        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Select Case Code&
            Case ERROR_SUCCESS
                'Don't return an error message
         Case ERROR_BADDB
              MsgBox "Corrupt Registry Database!", vbCritical, "Registry Error!"
         Case ERROR_BADKEY
              MsgBox "Key name is bad! - " & keyname, vbCritical, "Registry Error!"
         Case ERROR_CANTOPEN
             MsgBox "Cannot Open Key! - " & keyname, vbCritical, "Registry Error!"
         Case ERROR_CANTREAD
              MsgBox "Cannot Read Key! - " & keyname, vbCritical, "Registry Error!"
         Case ERROR_CANTWRITE
             MsgBox "Cannot Write to Registry!" + Chr$(13) + "If you are running Windows NT YOU MUST BE LOGGED IN AS ADMINISTRATOR", vbCritical, "Registry Error!"
         Case ERROR_ACCESS_DENIED
             MsgBox "Access to Registry Denied!" + Chr$(13) + "If you are running Windows NT YOU MUST BE LOGGED IN AS ADMINISTRATOR", vbCritical, "Registry Error!"
         Case ERROR_OUTOFMEMORY
             MsgBox "Out of memory", vbCritical, "Registry Error!"
         Case ERROR_INVALID_PARAMETER
             MsgBox "Invalid Parameter", vbCritical, "Registry Error!"
         Case Else
             MsgBox "Undefined key error code: " + keyname, vbCritical, "Registry Error!"
             MsgBox "Attempting registry error recovery", vbOKOnly, "Registry Recovery"
         End Select



End Sub


Public Function RegistryOpenKey(hWndAlreadyOpenedKey&, OpenThisKey$) As Long


      Dim hWndOpenedKey&                   'the handle of the key opened by RegOpenKeyEx
      Dim lReturn As Long                  'the error value returned by the registry function

      lReturn = RegOpenKeyEx(hWndAlreadyOpenedKey&, OpenThisKey$, 0&, KEY_ALL_ACCESS, hWndOpenedKey&)

      Call modRegistry32.gAPIDisplayError(lReturn)

      RegistryOpenKey = hWndOpenedKey&


End Function

Public Function RegistryQueryValue(RegistryKey&, ValueName$, ValueDataType&, Optional keyname As String) As String


      Dim ReturnedRegValue As String       'the pointer to the buffer that holds the queried data
      Dim lpcbData As Long                 'the pointer to the size of the buffer pointed to by ReturnedRegValue
      Dim lReturn As Long                  'the error value returned by the registry function

              lpcbData = 255
              ReturnedRegValue = Space$(lpcbData)
       
              lReturn = RegQueryValueExString(RegistryKey&, ValueName$, 0&, ValueDataType&, ReturnedRegValue, lpcbData)
       
              Call modRegistry32.gAPIDisplayError(lReturn, RegistryKey, keyname)
               RegistryQueryValue = Left$(ReturnedRegValue, lpcbData)
 
End Function

Public Sub RegistryCloseKey(CloseThisKey&)

      Dim lReturn As Long                  'the error value returned by the registry function

      lReturn = RegCloseKey(CloseThisKey&)

      Call modRegistry32.gAPIDisplayError(lReturn)

End Sub

Public Function RegistryCreateKey(hWndAlreadyOpenedKey&, CreateThisKey$) As Long


      Dim hWndCreatedKey&                                 'The handle to the key created/opened by RegCreateKeyEx
      Dim lpdwDisposition As Long                         'Memory space for RegCreateKeyEx to dump unwanted status information of the key before it was created/opened
      Dim lpSecurityAttributes As typSECURITY_ATTRIBUTES     'left$ at NULL to accept the default security attributes
      Dim lReturn As Long                                  'the error value returned by the registry function

      lReturn = RegCreateKeyEx(hWndAlreadyOpenedKey&, CreateThisKey$, 0&, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, lpSecurityAttributes, hWndCreatedKey&, lpdwDisposition)


      Call modRegistry32.gAPIDisplayError(lReturn)



      RegistryCreateKey = hWndCreatedKey&

End Function
0
thangarajAuthor Commented:
Thank U. Yes It works Fine. How could i close the dialup which is connected ?
0
thangarajAuthor Commented:
Yes It works Fine. THank U.
How could i close the connecion ?
0
cantrellCommented:
Now that would be an entirely new question with new points wouldn't it?? < just kidding > Here you go....

-----------
Public Sub HangUp()

    Dim i As Long
    Dim lpRasConn(255) As RasConn
    Dim lpcb As Long
    Dim lpcConnections As Long
    Dim hRasConn As Long
    lpRasConn(0).dwSize = RAS_RASCONNSIZE
    lpcb = RAS_MAXENTRYNAME * lpRasConn(0).dwSize
    lpcConnections = 0
    ReturnCode = RasEnumConnections(lpRasConn(0), lpcb, lpcConnections)
    '     ' Drop ALL the connections that match the currect
    '     ' connections name.

    If ReturnCode = ERROR_SUCCESS Then

        For i = 0 To lpcConnections - 1

            If Trim$(ByteToString(lpRasConn(i).szEntryName)) = Trim$(ConfigureForm.lblISP) Then
                hRasConn = lpRasConn(i).hRasConn
                ReturnCode = RasHangUp(ByVal hRasConn)
            End If

            Next i

            End If

                ' It takes about 3 seconds to drop the connection.
                                                                                '
                          While
Connected_To_ISP
                          Wend

  End Sub


0
cantrellCommented:
You will have to replace the "ConfigureForm.lblISP" part with another function to get the users default ISP name... Here that is...
(a three for one deal :)

------------

Public Function Get_ISP_Name() As String

    Dim Hkey As Long
    Dim lpSubKey As String
    Dim phkResult As Long
    Dim lpValueName As String
    Dim lpReserved As Long
    Dim lpType As Long
    Dim lpData As String
    Dim lpcbData As Long
    Get_ISP_Name = ""

  '  If Connected_To_ISP Then
        lpSubKey = "RemoteAccess"
        ReturnCode = RegOpenKeyEx(HKEY_CURRENT_USER, lpSubKey, 0, KEY_ALL_ACCESS, phkResult)
       
            If ReturnCode = ERROR_SUCCESS Then
            Hkey = phkResult
            lpValueName = "Default"
            lpReserved = APINULL
            lpType = APINULL
            lpData = APINULL
            lpcbData = APINULL
            ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, ByVal lpData, lpcbData)
            lpData = String$(lpcbData, 0)
            ReturnCode = RegQueryValueEx(Hkey, lpValueName, lpReserved, lpType, ByVal lpData, lpcbData)

            If ReturnCode = ERROR_SUCCESS Then Get_ISP_Name = Left$(lpData, lpcbData - 1)
           
            RegCloseKey (Hkey)
        End If

 '     End If
 
'if we don't have a popserver listed already, see if we can find one in the registry.
'this is most helpful for new users.
 
  If Len(Get_ISP_Name) = 0 Then Get_ISP_Name = "NO DEFAULT ISP DETECTED!"

End Function




0
thangarajAuthor Commented:
Yes it works fine. Thank U
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.