IHTMLElement -> IAccessible

旧时模样 提交于 2019-12-11 13:13:20

问题


How to get IAccessible from IHTMLElement?

I have receive "Interface is not support" error.


回答1:


Not all HTML elements are accessible. See Accessible HTML Elements (there's also a list of accessible elements below). You might have hit an element that is not meant to be accessible.




回答2:


Use IServiceProvider::QueryService - full details at this article.

Basic idea is that QueryService is like a less strict version of QI: QI requires that all the interfaces are part of the same COM object and uphold certain COM guarantees (shared IUnknown, reflexitivity and transitivity). But QueryService can be used to allow access to related interfaces on separate objects. IE happens to use it a fair bit. To use it, QI the IHTMLElement to IServiceProvider, then use the QueryService method to ask for an IAccessible.



来源:https://stackoverflow.com/questions/6994469/ihtmlelement-iaccessible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!