IResultDataCompare::Compare

[This is preliminary documentation and subject to change.]

Provides a way for a snap-in component to compare cookies for the purpose of sorting.

HRESULT Compare(
  long lUserParam,  // User-provided information
  long cookieA,     // Unique identifier of first object
  long cookieB,     // Unique identifier of second object
  int * pnResult    // Column being sorted
);
 

Parameters

lUserParam
[in] Specifies user-provided information that is passed into IResultData::Sort. The console does not interpret this parameter.
CookieA
[in] The unique identifier of the first object to be compared as part of the sorting operation.
CookieB
[in] The unique identifier of the second object to be compared as part of the sorting operation.
pnResult

[in,out] As an in parameter, the argument contains the column that is being sorted. As an out parameter, the value of the argument should be -1, 0, or 1.

Return Values

S_OK
The comparison was successful.

Remarks

Compare provides a mechanism for determining the sort order of objects appearing in the result pane. The built-in sort provided by the console only uses the C runtime's string-compare function to compare the data. If this interface is implemented, then it is used for all comparisons.

The comparison should be based on ascending sort order. If the user toggles the standard result view header, the console will compliment the compare results and this will result in descending order sort.

See Also

IResultData::Sort