This documentation is archived and is not being maintained.

DECLARE_PERF_OBJECT

Visual Studio .NET 2003

Use this macro to declare a new performance object from within a CPerfObject-derived class.

#define DECLARE_PERF_OBJECT(
   objectclass,
   dwObjectId,
   namestring,
   helpstring,
   defcounter
)

Parameters

objectclass
The name of the CPerfObject-derived class being defined.
dwObjectId
A numeric ID that uniquely represents each performance object contained within the CPerfMon derived class. This value is used to identify the object type when calling CPerfMon::CreateInstance or CPerfMon::CreateInstanceByName.
namestring
The name that is displayed for this object within the Performance Monitoring Console. Can be provided as a string or a resource ID.
helpstring
A help string that is displayed for this object within the Performance Monitoring Console. Can be provided as a string or a string resource ID.
defcounter
A zero-based index of the counter that should be selected by default when viewing objects of this type, or -1 if there is no default counter.

Remarks

This macro, with the BEGIN_COUNTER_MAP, DEFINE_COUNTER, and END_COUNTER_MAP macros, is used to define performance monitoring objects. The DECLARE_PERF_OBJECT macro should appear before the counter map. These macros are used implicitly by the performance monitor attributes, so they do not need to appear in attributed code.

Requirements

Header: atlperf.h

Example

See the PerformanceCounter Sample and the PerformanceScribble Sample.

See Also

Performance Monitoring | ATL Server Reference | Performance Monitoring Reference

Show: