Dual Interfaces: IAccessible and IDispatch

Server developers must provide the standard COM interface IDispatch for their accessible objects. The IDispatch interface allows client applications written in Microsoft Visual Basic and various scripting languages to use the methods and properties exposed by IAccessible. Since an accessible object provides access to an object either indirectly through IDispatch::Invoke or directly with IAccessible, it is said to have a dual interface.

When C/C++ clients get back an IDispatch interface pointer, clients can call QueryInterface to try converting the IDispatch interface pointer to an IAccessible interface pointer. To call the IAccessible methods indirectly, C/C++ clients call IDispatch::Invoke. For improved performance, call the IAccessible methods to use the object directly.

For a list of the dispatch IDs (DISPIDs) that IDispatch uses to identify the IAccessible methods and properties, see Appendix C: IAccessible DISPIDs.

Note to server developers  Under version 2.0 and later of Microsoft Active Accessibility, servers do not have to fully implement the methods of IDispatch but can simply return E_NOTIMPL after initializing any out parameters, as shown in the following example.

HRESULT STDMETHODCALLTYPE AccServer::GetTypeInfoCount(UINT* pctinfo)
    *pctinfo = 0;
    return E_NOTIMPL;