CMap 怎么使用自定义的类作为key

CMap 如何使用自定义的类作为key?
typedef CMap<UndefinedType,UndefinedType &,UndefinedType *,UndefinedType *> AttribMap;

UndefinedType 是我定义的类型。

然后我定义了函数
UINT AFXAPI HashKey(UndefinedType & key)
{
AfxMessageBox("HH");
//……
}

在测试的时候,不会进入次函数。
请问,应该如何做?
------解决思路----------------------
解决问题就好,一般提示错误信息中可以看到,不过模板库的错误信息一般很让人抓狂