Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

sylvain.werdefroy
Hi all,

This little peace of  code works fine with Firefox 3.0.6 and Firefox
3.1B2, but does not with Firefox 3.0.7!

My aim is to get the current document URL, and w is the handle to the
"MozillaWindowClass" class Window :

hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) ...
varStart.vt=VT_I4;
varStart.lVal=CHILDID_SELF;
hr=pAccessible->accNavigate(0x1009,varStart,&varResult); // 0x1009 =
NAVRELATION_EMBEDS
if (FAILED(hr)) ...
if (varResult.vt!=VT_DISPATCH) ...
pIDispatch=(IDispatch *)varResult.lVal;
if (pIDispatch==NULL) ...
hr =pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
&pSimpleDOMDocument);
if (FAILED(hr)) ...
hr = pSimpleDOMDocument->get_URL(&bstrURL);
if (FAILED(hr)) ...

The "pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
&pSimpleDOMDocument);" statement returns 0x80004002. So I cannot get
my URL...

Any clue?

Thanks!

- Sylvain

Aaron, if you're reading this, I would be very pleased if you could
help :-).
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

sylvain.werdefroy
On 6 mar, 00:26, [hidden email] wrote:

> Hi all,
>
> This little peace of  code works fine with Firefox 3.0.6 and Firefox
> 3.1B2, but does not with Firefox 3.0.7!
>
> My aim is to get the current document URL, and w is the handle to the
> "MozillaWindowClass" class Window :
>
> hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
> OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
> if (FAILED(hr)) ...
> varStart.vt=VT_I4;
> varStart.lVal=CHILDID_SELF;
> hr=pAccessible->accNavigate(0x1009,varStart,&varResult); // 0x1009 =
> NAVRELATION_EMBEDS
> if (FAILED(hr)) ...
> if (varResult.vt!=VT_DISPATCH) ...
> pIDispatch=(IDispatch *)varResult.lVal;
> if (pIDispatch==NULL) ...
> hr =pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> &pSimpleDOMDocument);
> if (FAILED(hr)) ...
> hr = pSimpleDOMDocument->get_URL(&bstrURL);
> if (FAILED(hr)) ...
>
> The "pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> &pSimpleDOMDocument);" statement returns 0x80004002. So I cannot get
> my URL...
>
> Any clue?
>
> Thanks!
>
> - Sylvain
>
> Aaron, if you're reading this, I would be very pleased if you could
> help :-).

Another test I did this morning: this very more simple peace of code
does not work with Firefox 3.0.7 (but works with 3.0.6 & 3.1B2):

w is now the handle of the "MozillaContentWindowClass" class window.

hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
OBJID_CLIENT,IID_ISimpleDOMDocument,(void**)&pSimpleDOMDocument);

hr is 0x80004002 with Firefox 3.0.7... :-(

- Sylvain
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

Marco Zehe-3
In reply to this post by sylvain.werdefroy
Sylvain,

There was a change we made to QueryService for Firefox 3.0.7, see bug
458871 <https://bugzilla.mozilla.org/show_bug.cgi?id=458871>. We didn't
change QueryInterface, though. What happens if you pass in the
iSimpleDomNode IID instead of iSimpleDOMDocument?

Marco

On 06.03.2009 00:26, [hidden email] wrote:

> Hi all,
>
> This little peace of  code works fine with Firefox 3.0.6 and Firefox
> 3.1B2, but does not with Firefox 3.0.7!
>
> My aim is to get the current document URL, and w is the handle to the
> "MozillaWindowClass" class Window :
>
> hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
> OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
> if (FAILED(hr)) ...
> varStart.vt=VT_I4;
> varStart.lVal=CHILDID_SELF;
> hr=pAccessible->accNavigate(0x1009,varStart,&varResult); // 0x1009 =
> NAVRELATION_EMBEDS
> if (FAILED(hr)) ...
> if (varResult.vt!=VT_DISPATCH) ...
> pIDispatch=(IDispatch *)varResult.lVal;
> if (pIDispatch==NULL) ...
> hr =pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> &pSimpleDOMDocument);
> if (FAILED(hr)) ...
> hr = pSimpleDOMDocument->get_URL(&bstrURL);
> if (FAILED(hr)) ...
>
> The "pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> &pSimpleDOMDocument);" statement returns 0x80004002. So I cannot get
> my URL...
>
> Any clue?
>
> Thanks!
>
> - Sylvain
>
> Aaron, if you're reading this, I would be very pleased if you could
> help :-).

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

sylvain.werdefroy
On 7 mar, 09:21, Marco Zehe <[hidden email]> wrote:

> Sylvain,
>
> There was a change we made to QueryService for Firefox 3.0.7, see bug
> 458871 <https://bugzilla.mozilla.org/show_bug.cgi?id=458871>. We didn't
> change QueryInterface, though. What happens if you pass in the
> iSimpleDomNode IID instead of iSimpleDOMDocument?
>
> Marco
>
> On 06.03.2009 00:26, [hidden email] wrote:
>
>
>
> > Hi all,
>
> > This little peace of  code works fine with Firefox 3.0.6 and Firefox
> > 3.1B2, but does not with Firefox 3.0.7!
>
> > My aim is to get the current document URL, and w is the handle to the
> > "MozillaWindowClass" class Window :
>
> > hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
> > OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
> > if (FAILED(hr)) ...
> > varStart.vt=VT_I4;
> > varStart.lVal=CHILDID_SELF;
> > hr=pAccessible->accNavigate(0x1009,varStart,&varResult); // 0x1009 =
> > NAVRELATION_EMBEDS
> > if (FAILED(hr)) ...
> > if (varResult.vt!=VT_DISPATCH) ...
> > pIDispatch=(IDispatch *)varResult.lVal;
> > if (pIDispatch==NULL) ...
> > hr =pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> > &pSimpleDOMDocument);
> > if (FAILED(hr)) ...
> > hr = pSimpleDOMDocument->get_URL(&bstrURL);
> > if (FAILED(hr)) ...
>
> > The "pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> > &pSimpleDOMDocument);" statement returns 0x80004002. So I cannot get
> > my URL...
>
> > Any clue?
>
> > Thanks!
>
> > - Sylvain
>
> > Aaron, if you're reading this, I would be very pleased if you could
> > help :-).- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

Marco,

Thank you for your response. Unfortunately, QueryInterface with
IID_ISimpleDOMNode also fails with 0x80004002 error code.

This error code means E_NOINTERFACE, while the change you made in
3.0.7 seems to return the E_INVALIDARG error code.

Another idea ?

- Sylvain
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: Querying ISimpleDOMDocument on MozillaWindowClass returns 0x80004002 with FF 3.0.7 (works fine with 3.0.6 & 3.1B2 !)

sylvain.werdefroy
On 7 mar, 11:45, Sylvain <[hidden email]> wrote:

> On 7 mar, 09:21, Marco Zehe <[hidden email]> wrote:
>
>
>
>
>
> > Sylvain,
>
> > There was a change we made to QueryService for Firefox 3.0.7, see bug
> > 458871 <https://bugzilla.mozilla.org/show_bug.cgi?id=458871>. We didn't
> > change QueryInterface, though. What happens if you pass in the
> > iSimpleDomNode IID instead of iSimpleDOMDocument?
>
> > Marco
>
> > On 06.03.2009 00:26, [hidden email] wrote:
>
> > > Hi all,
>
> > > This little peace of  code works fine with Firefox 3.0.6 and Firefox
> > > 3.1B2, but does not with Firefox 3.0.7!
>
> > > My aim is to get the current document URL, and w is the handle to the
> > > "MozillaWindowClass" class Window :
>
> > > hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
> > > OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
> > > if (FAILED(hr)) ...
> > > varStart.vt=VT_I4;
> > > varStart.lVal=CHILDID_SELF;
> > > hr=pAccessible->accNavigate(0x1009,varStart,&varResult); // 0x1009 =
> > > NAVRELATION_EMBEDS
> > > if (FAILED(hr)) ...
> > > if (varResult.vt!=VT_DISPATCH) ...
> > > pIDispatch=(IDispatch *)varResult.lVal;
> > > if (pIDispatch==NULL) ...
> > > hr =pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> > > &pSimpleDOMDocument);
> > > if (FAILED(hr)) ...
> > > hr = pSimpleDOMDocument->get_URL(&bstrURL);
> > > if (FAILED(hr)) ...
>
> > > The "pIDispatch->QueryInterface(IID_ISimpleDOMDocument, (void**)
> > > &pSimpleDOMDocument);" statement returns 0x80004002. So I cannot get
> > > my URL...
>
> > > Any clue?
>
> > > Thanks!
>
> > > - Sylvain
>
> > > Aaron, if you're reading this, I would be very pleased if you could
> > > help :-).- Masquer le texte des messages précédents -
>
> > - Afficher le texte des messages précédents -
>
> Marco,
>
> Thank you for your response. Unfortunately, QueryInterface with
> IID_ISimpleDOMNode also fails with 0x80004002 error code.
>
> This error code means E_NOINTERFACE, while the change you made in
> 3.0.7 seems to return the E_INVALIDARG error code.
>
> Another idea ?
>
> - Sylvain- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

Yes ! I've just found the solution ! Here is the code that works fine
to retrieve current document URL with Firefox 3.0.7 and Firefox
3.1B2 :

(w is the handle of the "MozillaContentWindowClass" class window)

hr=AccessibleObjectFromWindow(tSuivi.w,(DWORD)
OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
if (FAILED(hr)) ...
hr =pAccessible->QueryInterface(IID_IServiceProvider, (void**)
&pServiceProvider);
if (FAILED(hr)) ...
hr =pServiceProvider->QueryService(refguid,IID_ISimpleDOMDocument,
(void**) &pSimpleDOMDocument);
if (FAILED(hr)) ...
hr = pSimpleDOMDocument->get_URL(&bstrURL);
if (FAILED(hr)) ...

:-)

- Sylvain


_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility