CMapEx is a class derived from the MFC template class "CMap". It is designed to allow the "CompareElements" method which CMap uses at runtime, to be specified via a template parameter rather than via a global function. This approach is much more flexible and allows the way data is stored in the map to be configured at an instance level, rather than the annoying limitation in CMap which due to its design only allows you to control this globally i.e. if you have multiple map instances which happen to store the same types of data, then all of these instances must use the same "CompareElements" method. This is quite a limitation which I have just recently encountered in one of my projects. Finally, please note that there is a std::map class in the C++ runtime which is much more fully featured than the MFC CMap class and you should aim to use this in preference to CMap/CMapEx in all your Visual C++ development work.
The enclosed zip file contains source code for the class and also includes a VC 2017 project file to demonstrate the code.
v1.03 (26 December 2018)
v1.02 (29 April 2017)
v1.01 (21 February 2016)
v1.0 (11 June 2009)