[Accessibility-ia2] queryService and switching IAccessible2 interfaces

Michael Curran michaeldamiencurran at gmail.com
Fri Dec 5 22:41:49 PST 2008

Hi all,

I noticed a paragraph in accessible2.idl which I was not aware of in all 
my time of using IAccessible2:

   Regarding switching between any of the IAccessible2 interfaces, ATs 
typically use QueryInterface.
   This is because it is typical for applications implementing 
IAccessible2 to implement all
   IAccessible2 interfaces on a single object.  However it is possible 
that an application could
   use more than one object to implement the full set of IAccessible2 
interfaces and as a result
   QueryService would have to be used.  If your AT is using the 
IAccessible2 interfaces and you want
   to allow for access to the widest range of existing and future 
applications you should use
   QueryService rather than QueryInterface.  If the interface being 
switched to is implemented on
   the same object there shouldn't be a noticeable difference in 
performance and if the interface is
   implemented on another object the application can transfer the 
request to the secondary object
   saving exception handling code in the AT.

Is this really true for all current applications supporting IAccessible2?

I always knew that queryService must be used when getting IAccessible2 
objects from IAccessible objects, but I was not aware that queryService 
could be used to switch between interfaces on the IAccessible2 object.

NVDA certainly does not do this, it just uses queryInterface in this case.

Is this paragraph really valid? should NVDA be using queryService to for 
example get IAccessibleText from IAccessible2?

Is this actually supported in Gecko, Lotus?


More information about the Accessibility-ia2 mailing list