i was reading mfc book by jeff. i had installed vs 2005 . i tried simple programme but it does not works
just add this to onpaint
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
dc.DrawText("hi ",-1,&rect,DT_CENTER);
but there is no display in output

simple question
Waynestir
even tried to kept break point on - CPaintDC dc(this)
but it does not stop there just it runs
thanx for the reply
Taddub
According to an earlier post, his breakpoint in OnPaint() is not being hit.
If it's taking two days to address a simple issue, I'd start from scratch with a sample (Scribble ) that demonstrates OnPaint and then compare differences.
Ryan Milligan
void CMainWindow::OnPaint () { CPaintDC dc (this); CRect rect; GetClientRect (&rect); dc.DrawText (_T ("Hello, MFC"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); }
this the code i addded to my sdi application
i use visual studio 2005
VisualMaya
here is message map:
BEGIN_MESSAGE_MAP(CChildView, CWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
here is onpaint part:
void CChildView::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect (&rect);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
Nadi
Martin Ennemoser
ON_WM_PAINT()
END_MESSAGE_MAP()
this what u say
WinXP_Powered
This is wrong!
I guess you created a SDI Doc View program! In this case you placed the paint code in the Main frame window. The main frame window is completely covered by your View window. Place the code into your View!
LFS
That looks fine to me. What sort of project did you create Did you use a template What class is handling your onpaint method If you put in a breakpoint, does it get called
DeadLine
Carl-Johan Larsson
What color are you writing with If you're writing white on white, you won't see anything.
-Ben