共用方式為


perf_object

Apply this attribute to a class to define a performance monitor object.

[ perf_object(
      name_res,
      help_res,
      namestring,
      helpstring,
      detail,
      no_instances,
      class,
      maxinstnamelen
) ]

Parameters

  • name_res
    The name of the performance object, as a resource ID. Not necessary if a name is provided in string form using the namestring argument.

  • help_res
    A help string for the performance object, as a resource ID. Not necessary if the help string is provided in string form using the helpstring argument.

  • namestring
    The name of the performance object, as a string. Not necessary if a name is provided as a resource ID using the name_res argument.

  • helpstring
    A help string for the performance object, as a string. Not necessary if a help string is provided as resource ID using the help_res argument.

  • detail
    Specifies the detail level desired for the object. Default is PERF_DETAIL_NOVICE. Possible values are:

    Detail level

    Description

    PERF_DETAIL_NOVICE

    Indicates that this counter may be meaningful to most users. This is the most common counter detail level.

    PERF_DETAIL_ADVANCED

    Indicates that this counter is likely to be useful only to advanced users.

    PERF_DETAIL_EXPERT

    Indicates that this counter is likely to be useful only to the most advanced users.

    PERF_DETAIL_WIZARD

    Indicates that this counter is not likely to be useful to any users.

  • no_instances
    Specifies the performance object is instanceless if set to true. Default is false.

  • class
    Specifies the CPerfMon-derived class to which this object applies. By default, the next encountered name is used.

  • maxinstnamelen
    Specifies the maximum length of an instance name. Default is ATLPERF_DEFAULT_MAXINSTNAMELENGTH.

Requirements

Header

atlperf.h

Project

EXE, DLL

Compiler

/D "_ATL_ATTRIBUTES"

For more information about the meaning of the requirements, see Attribute Requirements.

Remarks

This attribute is used at the class level to specify a class as a performance monitoring object by adding CPerfObject as a base class. See Adding an ATL Performance Monitor Object for instruction on using Visual Studio code wizards to add performance monitoring support to your project.

Example

See the example for the perf_counter attribute.

Requirements

Attribute Context

Applies to

class, struct

Repeatable

No

Required attributes

None

Invalid attributes

None

For more information about the attribute contexts, see Attribute Contexts.

See Also

Concepts

perf_counter

perfmon

COM Attributes

Class Attributes

ATL Samples