2017-09-03 53 views
0

我有一个html div元素,当我检查get_borderBottomStyle()时有一个“固体”属性。我想要以像素为单位获取边框的值。所有其他方面(顶部,左侧和右侧)赋予它们各自样式的“无”属性。在这种情况下可以获得边界值吗?如果是的话,请让我知道我怎么能得到它。如何获取C++中html元素的底部边框宽度(使用msdn api的/属性)?

我试过使用get_borderBottomWidth(),它给出了一个BSTR索引和我需要的值。不知道我如何可以提取/利用这个。

更新: 似乎有一个get_borderWidth(),如果他们有一个风格的“无”返回边框的厚度型(中,薄或厚)的。在我的情况下,它返回中等中等1像素(分别为顶部,左/右和底部)。它属于VARIANT类型。有没有办法从这个方面获得价值?

+0

什么特定的库? MFC,ATL,CLI表单? – user0042

+0

visual C++库。 ATL – ghost

回答

0
pcurrentStyle->get_borderBottomWidth(&vtborderBottomWidth); //This gets the bstr address and the border width with px 
lborderBottom =vtborderBottomWidth.bstrVal;// This gets the border width with px 
char* borderBottom = NULL; 
borderBottom = convertBSTRToCharPtr(lborderBottom);// method which converts bstr value to char pointer 
long clborderBottom = atol(borderBottom);// converts the value to long. 
相关问题