I read code in MFC, but was confused with the code below:
void EditView::ResetDefaultFont()
{
HFONT hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
CDC* pDC = GetDC();
CFont* pFont = pDC->SelectObject(CFont::FromHandle(hFont));
pDC->SelectObject(pFont);
::DeleteObject(hFont);
}
Why CDC Select the default font first(CFont* pFont = pDC->SelectObject(CFont::FromHandle(hFont));
), but select pFont again?