PdhGetDoubleCounterValue (VB)

The Visual Basic PdhGetDoubleCounterValue function returns the current value of the specified counter as a double-precision floating point value. You should check CounterStatus before using the returned number, because the counter may not be valid when it is read. Call PdhIsGoodStatus to check the CounterStatus.

PdhGetDoubleCounterValue(
  ByVal CounterHandle as Long,  
  ByRef CounterStatus as Long)  
as Double
 

Parameters

CounterHandle
The ID of the counter whose current value is to be read.
CounterStatus
The variable in which the current status of the counter value is returned to the caller. The returned data value is valid if and only if the value returned in CounterStatus is PDH_CSTATUS_VALID_DATA or PDH_CSTATUS_NEW_DATA (defined in PDHDEFS.TXT). If the value returned in CounterStatus is any other value, do not use the data.

Return Values

PdhGetDoubleCounterValue returns the double-precision floating point value of the current counter, computed and formatted as defined by the counter type.

See Also

Performance Data Helper Overview, Performance Data Functions