佚名通过本文主要向大家介绍了
如何实现控件的Font属性?等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 如何实现控件的Font属性?
描述:
解决方案1:
描述:
我用VC的ATL的FullContrl写控件
我在MSDN上看见需要使用COleContrl这个类,但是FullContrl没有继承此类,请问如何实现固有属性Font?
解决方案1:
STDMETHODIMP CTrust::putref_Font(IFontDisp* pFont)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
CComPtr<IFont> spFont;
if (pFont == NULL)
{
return S_FALSE;
}
pFont->QueryInterface(&spFont);
if(m_pFont)
{
m_pFont.Release();
}
pFont->QueryInterface(&m_pFont);
FireViewChange();
return S_OK;
}