String Concatenation LPWSTR

In Visual C ++, I have

LPWSTR mystring; 

which is already defined elsewhere in the code.

I want to create a new LPWSTR containing:

 "hello " + mystring + " blablabla" (ie a concatenation) 

I'm angry with such a simple thing (concatenation)! Thank you very much, I am lost!

+8
c ++ string string-concatenation winapi concatenation
source share
2 answers

C ++ method:

 std::wstring mywstring(mystring); std::wstring concatted_stdstr = L"hello " + mywstring + L" blah"; LPCWSTR concatted = concatted_stdstr.c_str(); 
+14
source share
+4
source share

All Articles