#pragma once class CMapStringToPtrNoCase : public CMapStringToPtr { public: BOOL Lookup(LPCTSTR key, void*& rValue) const { CString currentKey; POSITION pos = GetStartPosition(); while (pos) { GetNextAssoc(pos, currentKey, rValue); if (_tcsicmp(currentKey, key) == 0) { return TRUE; } } return FALSE; } //// 重载HashKey方法,使用CString::MakeUpper方法将键值转换为大写,然后调用父类的HashKey方法 //UINT HashKey(LPCTSTR key) const { // CString upperKey = key; // upperKey.MakeUpper(); // return CMapStringToPtr::HashKey(upperKey); //} //// 重载CompareElements方法,使用CString::CompareNoCase方法来比较键值 //BOOL CompareElements(LPCTSTR key1, LPCTSTR key2) const { // CString strKey1(key1); // CString strKey2(key2); // return strKey1.CompareNoCase(strKey2) == 0; //} };