c++ - How to convert char* to TCHAR[ ]? -


this question has answer here:

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); 

details on msdn


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -