Display Texts in a Window
- MFC provides a function TextOut() to display texts.
The syntax is: TextOut(x, y, str).
-
If you encounter a syntax error at compiling:
error C2664: 'BOOL CDC::TextOutW(int,int,const CString &)' : cannot
convert parameter 3 from 'const char [2]' to 'const CString &'
- Please convert the
string with the macro _T() so that it will
automatically convert your string to a suitable format.
- Draw a cosine function and annotate the X-axis, Y-axis, and the
origin as below.