I would like to convert a variable declared as an int to a CString for printing to the screen using a device context. In the code below, f, i, and s are all CStrings and m_windSpan is an int. I would like to print the int to the screen preceeded by the text. Casting the int to a CString does not generate a compiler error but does not produce the proper output. This code is from the OnDraw() function<br>
<br>
void CGuy2View::OnDraw(CDC* pDC)<br>
{<br>
CGuy2Doc* pDoc = GetDocument();<br>
ASSERT_VALID(pDoc);<br>
CString s, f, i;<br>
<br>
f = "Wind Span: ";<br>
i = (CString)m_windSpan;<br>
s = f + i;<br>
pDC->TextOut(250, 120, s);<br>
}<br>
<br>
I would appreciate help as I have not found anything useful in the Visual Studio documentation.<br>
Thank you.
<br>
void CGuy2View::OnDraw(CDC* pDC)<br>
{<br>
CGuy2Doc* pDoc = GetDocument();<br>
ASSERT_VALID(pDoc);<br>
CString s, f, i;<br>
<br>
f = "Wind Span: ";<br>
i = (CString)m_windSpan;<br>
s = f + i;<br>
pDC->TextOut(250, 120, s);<br>
}<br>
<br>
I would appreciate help as I have not found anything useful in the Visual Studio documentation.<br>
Thank you.