Declare Function RasEnumConnections _
      Lib "rasapi32.dll" Alias "RasEnumConnectionsA" _
         (lpRasconn As Any, _
          lpcB As Long, _
          lpcConnections As Long) As Long

解决方案 »

  1.   

    Declare Function RasGetConnectStatus _
          Lib "rasapi32.dll" Alias "RasGetConnectStatusA" _
            (ByVal hRasConn As Long, _
             lpRasConnStatus As Any) As Long
      

  2.   

    关于ras,这里有一个很全面介绍的站点。
      

  3.   

    MSDN:RasEnumConnections
    The RasEnumConnections function lists all active RAS connections. It returns each connection's handle and phone-book entry name. DWORD RasEnumConnections(
      LPRASCONN lprasconn,  // buffer to receive connections data
      LPDWORD lpcb,         // size in bytes of buffer
      LPDWORD lpcConnections
                            // number of connections written to buffer
    );
     
    Parameters
    lprasconn 
    Points to a buffer that receives an array of RASCONN structures, one for each RAS connection. Before calling the function, an application must set the dwSize member of the first RASCONN structure in the buffer to sizeof(RASCONN) in order to identify the version of the structure being passed. 
    lpcb 
    Points to a variable that contains the size, in bytes, of the buffer specified by lprasconn. On return, the function sets this variable to the number of bytes required to enumerate the RAS connections. 
    lpcConnections 
    Points to a variable that the function sets to the number of RASCONN structures written to the buffer specified by lprasconn. 
    Return Values
    If the function succeeds, the return value is zero.If the function fails, the return value is a nonzero error value listed in the RAS header file or one of ERROR_BUFFER_TOO_SMALL or ERROR_NOT_ENOUGH_MEMORY. Res
    If a connection was made without specifying a phone-book entry name, the information returned for that connection will give the connection phone number preceded by ".". QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Requires version 1.0 or later.
      Header: Declared in ras.h.
      Import Library: Use rasapi32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT.RasGetConnectStatus
    The RasGetConnectStatus function retrieves information on the current status of the specified remote access connection. An application can use this call to determine when an asynchronous RasDial call has completed. DWORD RasGetConnectStatus(
      HRASCONN hrasconn,  // handle to RAS connection of interest
      LPRASCONNSTATUS lprasconnstatus
                          // buffer to receive status data
    );
     
    Parameters
    hrasconn 
    Identifies the remote access connection for which to retrieve the status. This handle must have been obtained from RasDial or RasEnumConnections. 
    lprasconnstatus 
    Points to a RASCONNSTATUS structure that the function fills with status information. Before calling the function, an application must set the dwSize member of the structure to sizeof(RASCONNSTATUS) in order to identify the version of the structure being passed. 
    Return Values
    If the function succeeds, the return value is zero.If the function fails, the return value is a nonzero error value listed in the RAS header file or one of ERROR_BUFFER_TOO_SMALL or ERROR_NOT_ENOUGH_MEMORY. QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Requires version 1.0 or later.
      Header: Declared in ras.h.
      Import Library: Use rasapi32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT.
      

  4.   

    Private Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (ByRef lprasconna As RASCONN, ByRef lpdword As Long, ByRef lpdword As Long) As Long
    Private Declare Function RasGetConnectStatus Lib "rasapi32.dll" Alias "RasGetConnectStatusA" (ByVal hrasconn As Long, ByRef lprasconnstatusa As RASCONNSTATUS) As Long
    Private Const RAS_MaxEntryName As Long = 256
    Private Const RAS_MaxDeviceName As Long = 128
    Private Const RAS_MaxDeviceType As Long = 16
      

  5.   

    自己去下一個完整的APIViewer吧...里面都可以查的到....下次這樣的問題,就不用問別人了..