1. Defina CString str en público
en DOC.h ; 2. Inicialice str = "hello world" en DOC.cpp.
3. Agregue un mensaje en Ondraw de view.cpp. Haz que se vea.
en DOC.h ; 2. Inicialice str = "hello world" en DOC.cpp.
3. Agregue un mensaje en Ondraw de view.cpp. Haz que se vea.
CDC *pDC=this->GetDC();
pDC->TextOut(10,10,pDoc->str);
this->ReleaseDC(pDC);
或者
CClientDC dc(this);
dc.TextOut(10,10,pDoc->str);