If memory serves, you should be able to reduce that to something like:
- The BeginPaint/EndPaint is being handled automatically by the construction/destruction of the CPaintDC.
CEditorDoc* pDoc = GetDocument();
CPaintDC dc(this); // device context for painting
CBrush aBrush( RGB(0,0,0) );
- Using the constructor for the CRect makes things a little cleaner.
- RGB already returns a COLORREF, so no need to cast it.
- Using the CBrush constructor eliminates the call to CreateSolidBrush.
I don't know if this will fix your problem, but it might be worth a shot.