小弟刚开始学vc,想通过单选按钮的选择来动态改变edit控件的字体大小,用的是CWnd::SetFont(),编译可以通过,但是在运行时则出现Debug Assertion Failed!错误,看了半天不懂是哪里错了,设置的代码如下,请各位高手帮帮忙解决一下!
//声明字体变量
public:
LOGFONT font;
CFont myfont;
//初始化字体
BOOL CJdeditcolorDlg::OnInitDialog()
{
        ......
// TODO: Add extra initialization here
memset(&font,0,sizeof(LOGFONT));
strcpy(font.lfFaceName,"宋体");
font.lfWeight=FW_MEDIUM;
font.lfHeight=120;
myfont.CreateFontIndirect(&font);
m_edit.SetFont(&myfont);
return TRUE;  // return TRUE  unless you set the focus to a control
}//单选设置字体大小
void CJdeditcolorDlg::OnRadio5() 
{
// TODO: Add your control notification handler code here
font.lfHeight=100;
myfont.CreateFontIndirect(&font);
m_edit.SetFont(&myfont);
m_edit.SetFocus();
}void CJdeditcolorDlg::OnRadio6() 
{
// TODO: Add your control notification handler code here
font.lfHeight=75;
myfont.CreateFontIndirect(&font);
m_edit.SetFont(&myfont);
m_edit.SetFocus();
}void CJdeditcolorDlg::OnRadio7() 
{
// TODO: Add your control notification handler code here
font.lfHeight=50;
myfont.CreateFontIndirect(&font);
m_edit.SetFont(&myfont);
m_edit.SetFocus();
}void CJdeditcolorDlg::OnRadio8() 
{
// TODO: Add your control notification handler code here
font.lfHeight=25;
myfont.CreateFontIndirect(&font);
m_edit.SetFont(&myfont);
m_edit.SetFocus();
}