Boris Zbarsky wrote:

Neil wrote:

Actually the goodies are quite easily available from C++ but my nsCOMPtr foo may leave something to be desired:
nsCOMPtr<nsIBoxObject> boxObject;
browserXULElement->GetBoxObject(getter_AddRefs(boxObject));
nsCOMPtr<nsIDocShell> docShell;
boxObject->GetDocShell(getter_AddRefs(docShell));

I see no docShell property or getDocShell function on nsIBoxObject. What am I missing?

Whoops, missed out a QI there :-/ What confused me is that getDocShell is implemented on nsBoxObject so browser, editor and iframe can use the same implementation.
nsCOMPtr<nsIBoxObject> boxObject;
browserXULElement->GetBoxObject(getter_AddRefs(boxObject));
nsCOMPtr<nsIBrowserBoxObject> browserBoxObject(do_QueryInterface(boxObject));
nsCOMPtr<nsIDocShell> docShell;
browserBoxObject->GetDocShell(getter_AddRefs(docShell));
etc.


--
Warning: May contain traces of nuts.

_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to