char* stheParameterFileName = argv[1]; //I'm passing the file name as a parameter.
TCHAR szName [512];
How can I convert char*
to TCHAR []
?
If you include the header file:
#include "atlstr.h"
Then you can use the A2T macro as below:
// You'd need this line if using earlier versions of ATL/Visual Studio
// USES_CONVERSION;
char* stheParameterFileName = argv[1];
TCHAR szName [512];
_tcscpy(szName, A2T(stheParameterFileName));
MessageBox(NULL, szName, szName, MB_OK);