vb- RasConnectionStats probleem

Alles over programmeren en development binnen de IT-wereld
Gebruikersavatar
Erik
Elite Poster
Elite Poster
Berichten: 1321
Lid geworden op: 15 sep 2002, 02:46
Uitgedeelde bedankjes: 2 keer
Bedankt: 18 keer

hallo,

Ik probeer RasGetConnectionStatistics() aan het werk te krijgen in VB hij compiled maar doet niet wa ik wil verdomme :mrgreen:

Code: Selecteer alles

Private Declare Function RasEnumConnections Lib "rasapi32" Alias "RasEnumConnectionsA" (ByVal lprassconn As Long, ByVal lpcb As Long, ByVal lpcConnections As Long) As Long
Private Declare Function RasGetConnectionStatistics Lib "rasapi32" (ByVal HRasConn As Long, ByVal lpStatistics As Long) As Long
Private Type RASCONN
dwSize As Long
hRassConn As Long
szEntryName(0 To 256) As Byte
szDeviceType(0 To 16) As Byte
szDeviceName(0 To 128) As Byte
pad As Byte
End Type
Private Type RAS_STATS
dwSize As Long
dwBytesXmited As Long
dwBytesRcved As Long
dwFramesXmited As Long
dwFramesRcved As Long
dwCrcErr As Long
dwTimeOutErr As Long
dwHardWareoverrunErr As Long
dwFramingErr As Long
dwBufferOverrunErr As Long
dwCompressionRatioIn As Long
dwCompressionRatioOut As Long
dwBps As Long
dwConnectDuration As Long
End Type


Private Sub Form_Load()
Dim Conn As RASCONN
Dim Stats As RAS_STATS
Dim Y As Long, Z As Long
Conn.dwSize = Len(Conn)
Y = Conn.dwSize
If RasEnumConnections(VarPtr(Conn), VarPtr(Y), VarPtr(Z)) = 0 Then
Stats.dwSize = Len(Stats)
If RasGetConnectionStatistics(Conn.hRassConn, VarPtr(Stats)) = 0 Then
Label1.Caption = Stats.dwBytesRcved
End If
End If
End Sub

ik vraag mij af wat ik verkeerd doe ?
Registered Linux user #286313
Plaats reactie

Terug naar “Development”