Convert values to LPCTSTR with C++
Posted on 2011-10-06
I’m new on MS C++ 2008, so I have a probably very easy to you question, but for me, string operation in C are really amful, no matter my 10+ experience in proffesional programming. Look my code:
LPCTSTR sInfo; CString s;
long LongExample=20;LPCTSTR LPCTSTR_Example="newValue"; bool bool_example=true; __int64 qwFrameOffset = 232;
s="Software\\temp\\" + LongExample + LPCTSTR_Example + bool_example + qwFrameOffset ; // here I should join all values in a valiable - this
s="newvalue with new params";
I need to make in a LPCTSTR a couple of params and to save it with StradisLogFunction(sInfo); which accept LPCTSTR. Could you please send me example code how to convert and add othet data types to a LPCTSTR values? If a idea to make all in CString and later to convert it to LPCTSTR is not good, please offer other. It should be able to do this many times in a procedure as I show in my code.
Note that my project is unicode. As this is simple task I do not intend to include additional libraries.