Export (0) Print
Expand All
Expand Minimize

PdhRemoveCounter function

Removes a counter from a query.

Syntax


PDH_STATUS PdhRemoveCounter(
  _In_  PDH_HCOUNTER hCounter
);

Parameters

hCounter [in]

Handle of the counter to remove from its query. The PdhAddCounter function returns this handle.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code.

The following is a possible value.

Return codeDescription
PDH_INVALID_HANDLE

The counter handle is not valid.

 

Remarks

Do not use the counter handle after removing the counter from the query.

The following shows the syntax if calling this function from Visual Basic.

PdhRemoveCounter(
  ByVal CounterHandle as Long  
)
as Long

QueryHandle

[in] Identifies the counter to remove. The PdhVbAddCounter function returns the identifier.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

See also

PdhAddCounter
PdhOpenQuery

 

 

Community Additions

ADD
Show:
© 2014 Microsoft