我的style使用class定义的
<style type="text/css">
.stys{ font-size: 24px; font-family:FZKai-Z03; text-align:center; white-space:nowrap} 
.styd{ font-size: 20px; font-family:FZKai-Z03; white-space:nowrap;}</style> <a class="stys">xxxx</a>现在我用
pElement->getAttribute(attr,0,&attrvar);
attr赋值为"class"则attrvar得到值为NULL
当attr赋值为"style"得到一个VT_DISPATCH 的接口但是我不知道怎么用它
比如我想把font-size: 改为50px
我如何通过setAttribute实现功能???

解决方案 »

  1.   

    query IHTMLStyle interface from the dispatch
      

  2.   

    HRESULT IHTMLElement::get_style(IHTMLStyle **p);
      

  3.   

    IHTMLElement::style Property--------------------------------------------------------------------------------Retrieves an inline style sheet for the tag. SyntaxHRESULT IHTMLElement::get_style(IHTMLStyle **p);
    Parametersp
    Address of a pointer to the IHTMLStyle interface for the style sheet. 
    Return ValueReturns S_OK if successful, or an error value otherwise
    具体的看MSDN
      

  4.   

    http://msdn.microsoft.com/library/default.asp