> nsCOMPtr<nsIWebBrowser> brow  = ... comes e.g. from embedding
> nsCOMPtr<nsIWebNavigation> nav  = do_QueryInterface(brow)
> 
> nsCOMPtr<nsIDOMDocument> doc;
> nav->GetDocument(getter_AddRefs(doc));

Thank you but it does't work. I always have 0x8000ffff failure code.

In fact i get a web browser like this :
        nsCOMPtr<nsIWebBrowser> webBrowser;
        rslt = serviceManager->\
                GetServiceByContractID(\
                "@mozilla.org/embedding/browser/nsWebBrowser;1", \
                NS_GET_IID(nsIWebBrowser), \
                getter_AddRefs(webBrowser));    

is that correct ? 

After i put the lines
        nsCOMPtr<nsIWebNavigation> nav  = do_QueryInterface(webBrowser);

        nsCOMPtr<nsIDOMDocument> doc;
        rslt = nav->GetDocument(getter_AddRefs(doc));
        if(NS_FAILED(rslt)) return rslt;

but "doc" is still and always NULL...

I think the problem is how i can get a correct webBrowser object.

someone has an idea of the reason of the problem ?


On Fri, 18 Mar 2005 17:37:39 +0100, Michal Ceresna
<[EMAIL PROTECTED]> wrote:
> On Friday 18 March 2005 15:33, Laurent Mimoun wrote:
> > Could you please show me how retrieve in C++ the DOM of the current
> > web page displayed in firefox.
> 
> nsCOMPtr<nsIWebBrowser> brow  = ... comes e.g. from embedding
> nsCOMPtr<nsIWebNavigation> nav  = do_QueryInterface(brow)
> 
> nsCOMPtr<nsIDOMDocument> doc;
> nav->GetDocument(getter_AddRefs(doc));
> 
> best,
> Michal
> --
> Michal Ceresna,
> [EMAIL PROTECTED]
> 


-- 
Laurent MIMOUN
Ing�nieur JAVA / J2EE - NTIC
Tel : +336 19.67.22.36

_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to