Platform SDK: Performance Monitoring

Counters.Add

Adds a CounterItem object with the specified path to the Counters collection object for display by the SystemMonitor object.

Public Function Add(
  pathname as String
) as CounterItem

Parameters

pathname
[in] Specifies the counter path. The path can include a machine name, and must include a performance object name, an object instance name if the specified performance object supports multiple instances, and a counter name. This path specification is not case-sensitive.

Return Values

A reference to the added CounterItem object.

Remarks

If you specify a wildcard counter in the pathname parameter, the Add method creates one CounterItem object for each expanded path. The Add method then returns a pointer to the first added CounterItem.

If the wildcard would result in a duplicate counter, the error is not reported and no duplicate is created. If an error condition occurs before all counters are created, the error is reported and the remaining counters are not created.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Smonctrl.odl.

See Also

System Monitor Automation Interface Overview, System Monitor Automation Interface Methods