1234567891011121314151617
CBrush aBrush; if(m_brushStyle == BS_SOLID) { if(!aBrush.CreateSolidBrush(m_brushColor)) { //.... } } else { if( aBrush.CreateHatchBrush(m_brushStyle, m_brushColor) ) { //... } } CBrush* oldBrush = pDC->SelectObject(&aBrush);
12345678
CBrush* oldBrush; if(m_brushStyle == BS_NULL) { oldBrush = (CBrush*)pDC->SelectStockObject(NULL_BRUSH); } else { oldBrush = pDC->SelectObject(&aBrush); }