1、定义
CMapStringToString g_mapSoundNames;//等价于map<CString, CString> g_mapSoundNames;
2、初始化//g_SysSoundNames_Normal[m_index]是数组作为键值KEY,g_SysSoundNames[m_index]数组作为VLAUE值
for(int m_index=0; m_index < SYS_SOUND_COUNT;m_index++)
{
g_mapSoundNames.SetAt(g_SysSoundNames_Normal[m_index],g_SysSoundNames[m_index]);
}
3、查找
CString strValue;
g_mapSoundNames.Lookup(strname,strValue);
return strValue;
博客介绍了CMapStringToString的使用,包括定义,等价于map<CString, CString>;初始化时,以数组g_SysSoundNames_Normal作为键值,g_SysSoundNames数组作为值;还介绍了查找操作,通过Lookup方法查找对应值并返回。
4858

被折叠的 条评论
为什么被折叠?



