How to get IAccessible from 开发者_JS百科IHTMLElement?
I have receive "Interface is not support" error.
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.
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.
精彩评论