Prev: Confusing Minimize button behavior
Next: InitInstance gives a "Failed to create empty document" message
From: Joseph M. Newcomer on 31 May 2010 11:41 See below... On Mon, 31 May 2010 01:41:00 -0700 (PDT), Woody <ols6000(a)sbcglobal.net> wrote: >The culprit was a line > >pDC->SelectObject(CreateSolidBrush(color)); > >It was in the view's OnDraw function, not the OnPaint I showed, which >belonged to a different class. > >For some reason, the SelectObject continued to work properly. **** The SelectObject will work, because ::CreateSolidBrush is returning an HBRUSH. Note that there might be enough space to create a brush when there is not enough space to create a bitmap. By the way, this is a classic error. joe **** > >I used GDIView to trace the leak. Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
First
|
Prev
|
Pages: 1 2 Prev: Confusing Minimize button behavior Next: InitInstance gives a "Failed to create empty document" message |