views:

53

answers:

0

I have the following code:

IAccessible *pAccessible = NULL;
IServiceProvider *pServProv = NULL; 
AccessibleObjectFromWindow((HWND)0x0025093A, OBJID_CLIENT, IID_IAccessible, (void**)&pAccessible);

HRESULT hr = pAccessible->QueryInterface(IID_IServiceProvider, (void**)&pServProv);
if (SUCCEEDED(hr) && (pServProv != NULL))
{
    const GUID unused;
    ISimpleDOMDocument *pAccDoc = NULL;

    hr = pServProv->QueryService(unused, IID_ISimpleDOMDocument, (void**)&pAccDoc);

    if (SUCCEEDED(hr) && (pAccDoc != NULL))
    {
        // Success
    }
    else
    {
        // Failure
    }
}

The hard-coded HWND above is to an instance of MozillaContentWindowClass.

I can get as far as QueryService - AccessibleObjectFromWindow and QueryInterface both succeed and return non-NULL objects; however, QueryService returns 'Invalid Parameter'. I've seen other suggestions, one of which is not using QueryService - just calling QueryInterface with IID_ISimpleDom* - but those calls return a 'No Service' error.

I've also seen suggestions to navigate to the Document object, and get a reference to the node from there - but I'm not quite sure how to accomplish that (I'm new to IAccessibility).

I appreciate any insight.