API-Problem with RasGetConnectionStatistics_()

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manne.

I tried to use RasGetConnectionStatistics_() but get always the errormesssage "not a function, an array or a linked list".

Code: Select all

Structure RASCONN 
   dwSize.l 
   hRasConn.l 
   szEntryName.b[256] 
   szDeviceType.b[16] 
   szDeviceName.b[128] 
   pad.b 
EndStructure 

Structure RAS_STATS 
   dwSize.l 
   dwBytesXmited.l 
   dwBytesRcved.l 
   dwFramesXmited.l 
   dwFramesRcved.l 
   dwCrcErr.l 
   dwTimeoutErr.l 
   dwAlignmentErr.l 
   dwHardwareOverrunErr.l 
   dwFramingErr.l 
   dwBufferOverrunErr.l 
   dwCompressionRatioIn.l 
   dwCompressionRatioOut.l 
   dwBps.l 
   dwConnectDuration.l 
EndStructure 

DefType.l y, z 
conn.RASCONN 
stat.RAS_STATS 

conn\dwSize = SizeOf(RASCONN) 
y = conn\dwSize 

If RasEnumConnections_(@conn, @y, @z) = 0 
    stat\dwSize = SizeOf(RAS_STATS) 
    
    If RasGetConnectionStatistics_(@conn, @stat) = 0 
           Debug stat\dwAlignmentErr 
           Debug stat\dwBps 
           Debug stat\dwBufferOverrunErr 
           Debug stat\dwBytesRcved 
           Debug stat\dwBytesXmited 
           Debug stat\dwCompressionRatioIn 
           Debug stat\dwCompressionRatioOut 
           Debug stat\dwConnectDuration 
           Debug stat\dwCrcErr 
           Debug stat\dwFramesRcved 
           Debug stat\dwFramesXmited 
           Debug stat\dwFramingErr 
           Debug stat\dwTimeoutErr 
  EndIf 
EndIf 
Manne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bodind.

The right function is: "RasGetConnectStatus_" i think.

Dominique
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ebs.

According to API-Guide 3.7, "RasGetConnectionStatistics_()" is correct. It is in the "rasapi32" DLL. Does PureBasic have these functions defined?

Eric
Originally posted by Bodind

The right function is: "RasGetConnectStatus_" i think.

Dominique
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bodind.

Yes, i confirm.
Did you see too that: "Requires Windows 2000 or later; Win9x/ME: Not supported" ?

Dominique
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manne.

I use WIN XP SP1.
For sure thats not the problem, i think this function is in PB either not declared or not under RasGetConnectionStatistics_().

Manne
Post Reply