IHTMLElement -> IAccessible

2019-07-23 15:28发布

How to get IAccessible from IHTMLElement?

I have receive "Interface is not support" error.

2条回答
可以哭但决不认输i
2楼-- · 2019-07-23 15:33

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.

查看更多
Anthone
3楼-- · 2019-07-23 15:47

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.

查看更多
登录 后发表回答