mr_stevie
asked on
Multiple WCHAR_T to CString
Hey guys,
I have a series of wchar_t variables and I wish to combined them and make it into a CString variable:
// Example
wchar_t x1 = 'T';
wchar_t x2 = 'e';
wchar_t x3 = 's';
wchar_t x4 = 't';
CString test;
I wish to add x1, x2, x3 and x4 into the CString "test".
Thank you in advance!
I have a series of wchar_t variables and I wish to combined them and make it into a CString variable:
// Example
wchar_t x1 = 'T';
wchar_t x2 = 'e';
wchar_t x3 = 's';
wchar_t x4 = 't';
CString test;
I wish to add x1, x2, x3 and x4 into the CString "test".
Thank you in advance!
ASKER
Unfortunately I get the following error:
error C2440: 'initializing' : cannot convert from 'wchar_t' to 'ATL::CStringT<BaseType,St ringTraits >'
error C2440: 'initializing' : cannot convert from 'wchar_t' to 'ATL::CStringT<BaseType,St
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works like a charm!
Thanks mate!
Thanks mate!
wchar_t x2 = 'e';
wchar_t x3 = 's';
wchar_t x4 = 't';
CString test;
CString x1_temp = x1;
CString x2_temp = x2;
CString x3_temp = x3;
CString x4_temp = x4;
test = x1_temp + x2_temp + x3_temp + x4_temp;