Re: drawing in the dialog
Well what is going on is after your dialog is Init OnPaint() is called and whenever OnPaint() is being called the painting on your dialog will be "1" cause this is what you drawing in OnPaint().
All drawing should be in OnPaint()!
Cheers
Re: drawing in the dialog
adding to golanshahar.... Even if you draw anything else it will be erased because of the code in OnPaint. OnPaint is called whenever the window or it's any area needs to be redrawn, like in case of Window is moved, certain other top level window was minimized and your window comes to top etc... so that makes a lot of times of OnPaint execution.
Re: drawing in the dialog
But why I can do this similar thing without any problem in View? (using CClientDC in OnDraw instead of using CPaintDC in OnPaint)
What is the difference between CView and CDialog in terms of doing these kind of drawing job? thanks!