Hi All,
I'm using this code block to get the font name, style and size selected by the user from the font dialog of CMFCPropertyFontProperty control. I'm already able to get the name and the style, but the size seems to return a different value.
*CMFCPropertyGridProperty pCurSel = m_wndPropList.GetCurSel(); CMFCPropertyGridFontProperty* pFontProp = dynamic_cast(pCurSel);
if ( pFontProp ) {
LPLOGFONT font_info = pFontProp->GetLogFont();
INT nSize = 0;
nSize = font_info->lfHeight;
//nSize seems to return a negative value... :(
}**
I realize that there's a formula for it : lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
But I can't seem to get it working... how do I get the hDC from CMFCPropertyFontProperty? please help...