Output hello world in the window

1. Define CString str in public
in DOC.h ; 2. Initialize str="hello world" in DOC.cpp.
3. Add a message in Ondraw of view.cpp. Make it show.
CDC *pDC=this->GetDC();
pDC->TextOut(10,10,pDoc->str);
this->ReleaseDC(pDC);

或者


CClientDC dc(this);
dc.TextOut(10,10,pDoc->str);


Guess you like

Origin blog.csdn.net/u010256329/article/details/9398205