When using datetime control or when browsing databases date fields, international settings from the Windows Control Panel are ignored.
_tsetlocale(LC_ALL, NULL);
to initialize the international settings. This is wrong and you should call
_tsetlocale(LC_ALL, _T(""));
instead.