【问题标题】:How do I get the bottom border width of a html Element in c++(using msdn api's/property)?如何在 c++ 中获取 html 元素的底部边框宽度(使用 msdn api's/property)?
【发布时间】:2018-02-12 03:25:23
【问题描述】:

当我检查 get_borderBottomStyle() 时,我有一个具有“实心”属性的 html div 元素。我想以像素为单位获取边框的值。所有其他边(顶部、左侧和右侧)都给出了具有各自样式的“无”属性。在这种情况下是否可以获取边界值?如果是,请告诉我如何获得它。

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

更新: 似乎有一个 get_borderWidth() 如果它们的样式为“none”,则返回边框的厚度类型(中等、薄或厚)。在我的情况下,它返回中等中等 1 像素。(这些分别用于顶部、左/右和底部)。它的类型是 VARIANT。有没有办法只从中获取价值?

【问题讨论】:

  • 什么特别的库? MFC、ATL、CLI 表单?
  • 可视化 c++ 库。 ATL

标签: c++ border atl


【解决方案1】:
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.

【讨论】:

    猜你喜欢
    • 2012-04-03
    • 1970-01-01
    • 2019-01-03
    • 2021-06-10
    • 2022-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-04
    相关资源
    最近更新 更多