还是关于CFont类的问题
......
LOGFONT tempLogFont;
dlg.m_nFont.GetLogFont(&tempLogFont);
m_nFont.CreateFontIndirect(&tempLogFont);
......
我想把CFont的一个对象值从一个类传到别一个类
总是出现非法操作,编译没问题
大家帮帮忙看看,是什么原因
[解决办法]
断点调试一下就知道是在哪里了.
可能是下面的原因.你提供的信息太少了.
m_nFont.CreateFontIndirect(&tempLogFont
你的m_nFont对象一定要先是没有创建过的.否则要先删除内部对象.m_nFont.DeleteObject().