【发布时间】:2011-05-17 04:05:48
【问题描述】:
如何在 MFC(VC++) 中将 CString 转换为 Enum 类型?
我有一种将输入参数作为 Enum 的方法,但我将 Cstring 值传递给它,我如何将其转换为枚举。
CString strFolderType = strFolderType.Right(strFolderType.GetLength()-(fPos+1));
m_strFolderType = strFolderType ;
我有一种方法
ProtocolIdentifier(eFolderType iFolderType)
where enum eFolderType
{
eFTP = 1,
eCIFS,
eBOTH
};
现在当我这样打电话时:
ProtocolIdentifier(m_strFolderType);
它说不能将 CString 转换为 eFolderType ...
如何解决这个问题?
【问题讨论】:
标签: visual-c++ mfc