Add String::Collate() support for Windows CE
Brought to you by:
nenadstefanovic
Currently, CString::Collate() and CString::CollateNoCase() methods (atlmisc.h) are not available on Windows CE. I suggest adding the following Windows CE compatible version:
inline int CString::Collate(LPCTSTR lpsz) const
{
int nRet = CompareString(LOCALE_USER_DEFAULT, 0, m_pchData, -1, lpsz, -1);
ATLASSERT(nRet != 0);
return nRet - CSTR_EQUAL; // Convert to strcmp convention.
}
inline int CString::CollateNoCase(LPCTSTR lpsz) const
{
int nRet = CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, m_pchData, -1, lpsz, -1);
ATLASSERT(nRet != 0);
return nRet - CSTR_EQUAL; // Convert to strcmp convention.
}
Herbert
Anonymous
WTL doesn't support Windows Mobile any more