afNode*NewNode;
NewNode=AddFlowMain->SelectedNode;
if(NewNode!=NULL)
{
IFontDisp *temp22=(IFontDisp *)NewNode->Font;
IFont *piFont=NULL;
IFontDisp* pFontDisp=NULL;
HRESULT hr;
CY rt;
hr = (*temp22).QueryInterface(IID_IFont, (LPVOID *) &piFont);//通过COM获取地址
if(SUCCEEDED(hr))
{
piFont->get_Size(&rt);
TFontDialog*temp=new TFontDialog(NULL) ;
temp->Font->Size=rt.Lo/10000;
WideString tempWideString;
piFont->get_Name(&tempWideString);
temp->Font->Name=tempWideString;
temp->Font->Color=NewNode->ForeColor;
int bold;
piFont->get_Bold(&bold);
// typedef SetBase TFontStylesBase;
if (bold)
{
temp->Font->Style>>fsBold;
}
temp->Execute();
rt.Lo=temp->Font->Size*10000;
rt.Hi=0;
piFont->put_Size(rt);
NewNode->ForeColor= temp->Font->Color;
tempWideString=temp->Font->Name ;
piFont->put_Name(tempWideString);
if ( temp->Font->Style.Contains(fsBold))
{
piFont->put_Bold(1);
}
else
{
piFont->put_Bold(0);
}
delete temp;
}
}
//这方面的资料太少了。