Display Texts in a Window
- MFC provides a function TextOut() to display texts.
The syntax is: TextOut(x, y, str).
- Note that you should remember to uncheck "Unicode".
Otherwise you may 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 &'
- In case you forgot to uncheck that, you might 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.