Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CStatic* pWnd = (CStatic*) GetDlgItem(ID_STATIC_ONE);
pWnd->SetWindowText(data1+"and"+data2);
is this possible in vc++
Posted

No, use the Format[^] method of a CString object to create your text string.
 
Share this answer
 
This is NOT possible with with C-like strings, i.e. if data1 is defined in this (or similar) way:
C++
char data1[] = "foo";

Your best bet would be wrapping such pointers in a CString object, e.g.

C++
CString text = data1;
text += "and" + data2;
Wnd->SetWindowText(text);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900