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.
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);