"murray bryant" <[EMAIL PROTECTED]> a �crit dans le
message de news:[EMAIL PROTECTED]
> Darin Fisher wrote:
> > looks like you could do this:
> >
> > var browserContractID =
> > "@mozilla.org/embedding/browser/nsWebBrowser;1";
> >
> > var browser =
> > Components.classes[browserContractID].createInstance(
> > Components.interfaces.nsIInterfaceRequestor);
> >
> > var browserPrint = browser.getInterface(
> > Components.interfaces.nsIWebBrowserPrint);
> >
> > if (browserPrint instanceof Components.interfaces.nsIWebBrowserPrint){
> > printWindow = document.getElementByID("print-panel");
> > browserPrint.printPreview(null, printWindow);
> > }
> >
> > darin
> >
>
> Unfortunately i am still getting an error:
>
>
> Error: uncaught exception: [Exception... "Component returned failure
> code: 0x80004002 (NS_NOINTERFACE) [nsIInterfaceRequestor.getInterface]"
> nsresult: "0x80004002 (NS_NOINTERFACE)" location: "JS frame ::
>
http://skm-bsd.skm.harmonygold.com.au/xul/reports/reportsManager.xul?src=p_induction_expiry.php
> :: ppv :: line 26" data: no]
>
Hi all,
I am trying do achieve the same kind of thing, the only difference being
that I am working in C++, and I am stuck with the same problem. Here is the
kind of thing I am doing :
// Creation of the WebBrowser
nsresult rv;
nsCOMPtr<nsIWebBrowser>m_nspPrinter=do_CreateInstance(NS_WEBBROWSER_CONTRACT
ID, &rv);
// Request the nsIWebBrowserPrint interface
nsCOMPtr<nsIWebBrowserPrint>
nspWebBrowserPrint(do_QueryInterface(m_nspPrinter, &rv));
At this point, rv==0x80004002 (NS_NOINTERFACE), though this is very similar
to
http://lxr.mozilla.org/seamonkey/source/embedding/browser/activex/src/control/MozillaBrowser.cpp#1461
So the problem here is that the WebBrowserPrint interface is somehow not
implemented by our WebBrowser instance, though it should, as far as the
documentation I have read is concerned :
http://www.mozilla.org/projects/embedding/faq.html
Does anybody have an idea about this ?
Thanks in advance.
Mathieu CARTOIXA
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom