问题如下:
void test(const CFont &font)
{
CFont m_font;
LOGFONT logfont;
font.GetLogFont(&logfont);//有问题?
m_font.CreateFontIndirect(&logfong);}d:\t33\propertylist.h(33) : error C2662: 'GetLogFont' : cannot convert 'this' pointer from 'const class CFont' to 'class CFont &'
如果把参数中的const去掉,是可以通过
但是GetLogFont(&lpLogFont)并没有改变font中的内容,为什么不可以是const呢?