David Fancella wrote:
All,

Ok, I've got Mozilla successfully embedded, now I need to get the DOM from an open embedded browser. How? :)

Here's what I've got:

nsCOMPtr<nsIDOMWindow> mDOMWindow;
nsresult rv;
rv = mWebBrowser->GetContentDOMWindow(*mDOMWindow);
return mDOMWindow;

I seem to remember reading that it's not a good idea to return a nsCOMPtr from a function, though. The problem is in line 4 of this listing, rv = mWebBrowser etc....

The error is "no matching function for <function signature>", candidates are "virtual <unction signature>".

Do I have to overload that particular function in a nsIWebBrowser object? That doesn't seem right to me, for some reason...

Dave
From the embedding FAQ:

--snipp--

How do I get the DOM document from the web browser object?

  nsCOMPtr<nsIDOMDocument> doc;
  nsCOMPtr<nsIDOMWindow> window;
  webBrowser->GetContentDOMWindow(getter_AddRefs(window));
  if (window) {
    window->GetDocument(getter_AddRefs(doc));
  }

--snip--

/Jeremias


Reply via email to