I have found that CRT (and therefore MFC) doesn't directly support locale_invariant, but 1252 close enough (which is what ATL code used before locale_invariant support was added to ATL)

You shouldn't use setlocale(LC_ALL, "") which uses the current language for non Unicode programs and affects more than just character stuff, so you should use this instead:

_tsetlocale(LC_CTYPE, _T(".1252"))

it's as close to what Windows Explorer uses for case insensitive compare as you can get while using the CRT/MFC

sorry to beat a dead horse but this bit me recently so I thought I would post it here.