主要问题:比较所选文本的textrange与当前站点(显示在IE中)的文档范围时,无法让CompareEndpoints给出“1”以外的任何值。
//Initialize range variables iuiAutomationTextRange* documentRange = NULL; iuiAutomationTextRange* selectionRange = NULL; iuiAutomationTextRangeArray* selectionRangeArray = NULL; //Get entire text document range m_pTextPattern->get_DocumentRange(&documentRange); //Get selection range m_pTextPattern->GetSelection(&selectionRangeArray); selectionRangeArray->GetElement(0,&selectionRange);
范围是有效的,所选文本在文档范围内。 当我们尝试从文档/站点开始的起始处获取所选文本的移动/字符数时,则只返回1。
selectionRange->CompareEndpoints( TextPatternRangeEndpoint::TextPatternRangeEndpoint_Start,documentRange,TextPatternRangeEndpoint::TextPatternRangeEndpoint_Start,&rv);
防爆。 该网站: http : //www.cplusplus.com/reference/string/string/
我们从名为“string – C ++ Reference”的节点检索textpattern。 然后我们得到整个文档“documentRange”的文档范围,并用鼠标select一些文本,并将该范围保存到selectionRange ex。 “表示对象”(从std :: string下selectsite 3的文本)。
x-accel-redirect for mp4仅在Internet Explorer Windows 7上提供不受支持的videotypes
IIS:将Kerberos用于不在域中的客户端计算机
HTML链接到Samba共享中的目录,可用于Internet Explorer 7/8
我们已经尝试了记事本窗口,其中compareendpoints返回点textranges之间的有效/正确的距离。
例:
if (SUCCEEDED(hr)) { iuiAutomationTextRange* documentRange = NULL; iuiAutomationTextRangeArray* selectionRangeArray = NULL; iuiAutomationTextRange* selectionRange = NULL; hr = E_FAIL; hr = m_pTextPattern->get_DocumentRange(&documentRange); if (SUCCEEDED(hr) && documentRange != NULL) { hr = m_pTextPattern->GetSelection(&selectionRangeArray); if (SUCCEEDED(hr) && selectionRangeArray != NULL) { int length; hr = selectionRangeArray->get_Length(&length); if (SUCCEEDED(hr) && length > 0) { hr = selectionRangeArray->GetElement(0,&selectionRange); if (SUCCEEDED(hr) && selectionRange != NULL) { hr = selectionRange->CompareEndpoints(TextPatternRangeEndpoint::TextPatternRangeEndpoint_Start,&rv); wprintf(L"getSelectionStart rv: %dn",rv); } } } } if (documentRange != NULL) { documentRange->Release(); documentRange = NULL; } if (selectionRangeArray != NULL) { selectionRangeArray->Release(); selectionRangeArray = NULL; } if (selectionRange != NULL) { selectionRange->Release(); selectionRange = NULL; } } }
恼人的IE8下拉问题在XP中,但不是Windows 7
IE10在计算机被locking时JavaScript不能重画窗口?
如何以编程方式确定从脚本安装的IE版本
如何用CYGWIN会话中的URL启动IE
通过ruby脚本更改Windows浏览器代理设置
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。