Object::GetHashCode Method

Returns the IUnknown* identity value for this instance if it is a COM object, or a computed hash value if it is not a COM object.

int GetHashCode()

A numeric value that uniquely identifies this object.

You can use GetHashCode to create keys for objects in maps. You can compare hash codes by using Object::Equals Method. If the code path is extremely critical and GetHashCode and Equals are not sufficiently fast, then you can drop down to the underlying COM layer and do native IUnknown pointer comparisons.

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Header: vccorlib.h

© 2014 Microsoft