fix mixed char/wchar/TCHAR usage