调用字体对话框,并且想获得所选择设置的结果
CFont * m_pcurFont;
LOGFONT lf;
CFontDialog dlg(&lf);
int test=dlg.DoModal();
if(test==IDOK)
{
m_pcurFont=new CFont;
m_pcurFont->CreateFont(
dlg.GetSize, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
dlg.GetWeight, // nWeight
dlg.IsItalic, // bItalic
dlg.IsUnderline, // bUnderline
dlg.IsStrikeOut, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
(LPCTSTR)dlg.GetFaceName() ); // lpszFacename
}
为何,程序的最后一行老是报错:cannot convert parameter 1 from 'int (void) const' to 'int'。应该如何改正?
CFont * m_pcurFont;
LOGFONT lf;
CFontDialog dlg(&lf);
int test=dlg.DoModal();
if(test==IDOK)
{
m_pcurFont=new CFont;
m_pcurFont->CreateFont(
dlg.GetSize, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
dlg.GetWeight, // nWeight
dlg.IsItalic, // bItalic
dlg.IsUnderline, // bUnderline
dlg.IsStrikeOut, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
(LPCTSTR)dlg.GetFaceName() ); // lpszFacename
}
为何,程序的最后一行老是报错:cannot convert parameter 1 from 'int (void) const' to 'int'。应该如何改正?
改成dlg.GetSize(), // nHeight
dlg.IsItalic(), // bItalic
dlg.IsUnderline(), // bUnderline
dlg.IsStrikeOut(), // cStrikeOut