OnDraw
Hi, I have a CImageDoc class, derived form CDocument
The class has a
private:
CString m_ID_Res;
member
the OnNewDocument initialize the Doc, and then the OnDraw, member
function of the CImageView class is called, and the CString m_ID_Res
appears on the screen.
But, whe I modified the CString m_ID_Res member, throught a CImageDoc
function, then I can't display the new text. The way I tried to do so
is:
CImagenDoc newImage;
newImage.NewID( "m_ID_Res new CString viewalue"); //this modifies
m_ID_Res
newImagen.SetModifiedFlag(TRUE);
newImage.UpdateAllViews(NULL);
I was wondering why the OnDraw CView member function isn't called;
For clearness, the CImageView::OnDraw function is copied:
void COjoDeBifeView::OnDraw(CDC* pDC)
{
CImagenDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// Calculate the space required for a single
// line of text, including the inter-line area.
TEXTMETRIC tm;
pDC->GetTextMetrics( &tm );
int nLineHeight = tm.tmHeight + tm.tmExternalLeading;
CPoint ptText( 0, 0 );
CString szName = pDoc->GetIdRes();
pDC->TextOut( ptText.x, ptText.y, szName );
ptText.y += nLineHeight;
}
thanks.