Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#70 Add String::Collate() support for Windows CE

open
None
5
2007-07-01
2007-06-13
hfann
No

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

Discussion

    • assigned_to: nobody --> nenadstefanovic