Adds a CounterItem instance to the collection.
- pathname [in]
Path to the counter. 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.
For details on specifying a counter path, see Specifying a Counter Path.
|System.Runtime.InteropServices.COMException||You can receive this exception for one of the following reasons:|
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.
There is no limit to the number of counters that you can add; however, SYSMON will graph only the first 1,024 counters in the collection. There is no limit on the number of counters that SYSMON will display in a report.
To receive notification when a counter is added, implement the OnCounterAdded event.
Minimum supported client
|Windows 2000 Professional [desktop apps only]|
Minimum supported server
|Windows 2000 Server [desktop apps only]|
Build date: 11/16/2013