A TCHAR points to either a CHAR or a WCHAR based on the character set of your project. That cast will force a char pointer to point at a WCHAR data type and screw up your code.
Do not cast.
Stick with the TCHAR rules. That means no char, CHAR, PCHAR, WCHAR, LPSTR, LPWSTR, etc in your code. Only TCHAR and the TCHAR mappings and the TCHAR function equivalents.
Comment