首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

还是关于CFont类的有关问题

2012-01-30 
还是关于CFont类的问题......LOGFONTtempLogFontdlg.m_nFont.GetLogFont(&tempLogFont)m_nFont.CreateFo

还是关于CFont类的问题
......
  LOGFONT   tempLogFont;

  dlg.m_nFont.GetLogFont(&tempLogFont);

  m_nFont.CreateFontIndirect(&tempLogFont);

......

我想把CFont的一个对象值从一个类传到别一个类

总是出现非法操作,编译没问题
大家帮帮忙看看,是什么原因

[解决办法]
断点调试一下就知道是在哪里了.
可能是下面的原因.你提供的信息太少了.
m_nFont.CreateFontIndirect(&tempLogFont
你的m_nFont对象一定要先是没有创建过的.否则要先删除内部对象.m_nFont.DeleteObject().

热点排行