How can I append LPTSTR to CStirng
-
CString s; LPCTSTR st; s += CString(st); in fact, I thought s += st would work. Christian Graus - Microsoft MVP - C++ -- modified at 4:25 Friday 9th June, 2006
-
NoName II wrote:
How can I append LPTSTR to CStirng
Here is another way how we can append the LPTSTR to CString
CString strTest("Hello");
LPTSTR lpStr=" World";
strTest.Insert(strTest.GetLength(),lpStr);We can directly add the strings using += operator as it overloaded in CString class Knock out 't' from can't, You can if you think you can :cool:
-
See
LPTSTR lpt; lpt=(LPTSTR)LocalAlloc(LPTR,256); strcat(lpt,"test"); CString str; // str.SetString(lpt,4); // str=lpt; str=str+lpt; str.Insert(0,lpt); str.Append(lpt); LocalFree(lpt);
_**
**_
whitesky
-
have you ever tried the simplest way (with + or += operators) ?
CString str = "hello ";
str += "world !!";
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
NoName II wrote:
How can I append LPTSTR to CStirng
LPTSTR pSz="ALOK loves"; LPTSTR pSz2="CP" CString Combined Str=CString(pSz)+CString(pSz2);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You