When you work with RAS APIs, you should have to make sure if RAS library is installed on the system. A simple way is to verify the existence of the Rasapi32.dll file in the windows system directory; the same thing can be obtained with a call to the InternetGetConnectedState API, as the following code demonstrates:
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef _ lpdwFalgs As Long, ByVal dwReserved As Long) As BooleanConst INTERNET_RAS_INSTALLED = 16' Check whether RAS is installedFunction IsRASInstalled() As Boolean Dim connStatus As Long InternetGetConnectedState connStatus, 0& IsRASInstalled = (connStatus And INTERNET_RAS_INSTALLED)End Function