I want to convert string or char* to the _T but not able to do.
if i write
_tcscpy(cmdline,_T ("hello world"));
it works perfectly, but if i write
char* msg="hello world";
_tcscpy(cmdline,_T (msg));
it shows an error like: error C2065: 'Lmsg' : undeclared identifier
Please give me a solution.
Thanx in advance.
_Tis a macro, defined as (ifUNICODEis defined):which can work only with string-literals. So when you write
_T("hi")it becomesL"hi"which is valid, as expected. But when you write_T(msg)it becomesLmsgwhich is an undefined identifier, and you didn’t intend that.All you need is this function
mbstowcsas: