PdhCollectQueryData (VB)

The Visual Basic PdhCollectQueryData function collects the current raw value of each counter in the query referenced by the QueryHandle parameter and updates the internal buffers of each counter object.

PdhCollectQueryData(
  ByVal QueryHandle as Long)  
as Long
 

Parameters

QueryHandle
The ID of the query to update. This must be a value returned by a call to PdhOpenQuery.

Return Values

If the function succeeds, it returns a Long integer equal to ERROR_SUCCESS. Note that the function can return successfully, but some or all counters in the query may not have been updated.

If the function fails, the return value is a PDH error status defined in pdhdefs.txt. The following are possible error values:

PDH_INVALID_HANDLE
The query handle is not valid.
PDH_NO_DATA
The query does not have any counters defined yet.

See Also

Performance Data Helper Overview, Performance Data Functions