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

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -