c++ - How to convert char* to TCHAR[ ]? -
this question has answer here:
- convert char tchar* argv[] 2 answers
char* stheparameterfilename = argv[1]; //i'm passing file name parameter. tchar szname [512];
how can convert char*
tchar []
?
if include header file:
#include "atlstr.h"
then can use a2t macro below:
// you'd need 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);
Comments
Post a Comment