Hi all,
I'm new to the XPCOM programming.
I'm trying to create a component to be used from TestGtkEmbed (mozilla
browser test binary) that needs to use the nsIWebNavigation interface.
My code is this:
------------------
nsCOMPtr<nsIWebBrowser> theWebBrowser;
nsCOMPtr<nsIWebNavigation> theWebNav;
nsresult rv = NS_OK;
rv = NS_InitEmbedding(nsnull, nsnull);
theWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
if (NS_FAILED(rv))
printf("do_CreateInstance FAILED\n");
else
printf("do_CreateInstance SUCCEEDED\n");
theWebNav = do_QueryInterface(theWebBrowser, &rv);
if (NS_FAILED(rv))
printf("do_QueryInterface FAILED\n");
else
printf("do_QueryInterface SUCCEEDED\n");
// navigate back in the history
rv = theWebNav->GoBack();
if (NS_FAILED(rv))
printf("GoBack FAILED, rv = 0x%08x\n", rv);
else
printf("GoBack SUCCEEDED\n");
NS_TermEmbedding();
----------------------
The problem is that I always get "GoBack FAILED, rv = 0x8000ffff".
As you can see I've added the NS_InitEmbedding call but nothing has changed.
Unfortunately I'm not able to use these methods (like loadURI, goBack
etc...).
Must I get the main browser reference instead of using
do_CreateInstance(NS_WEBBROWSER_CONTRACTID)?
And how to to that?
Please help me!!
G
--
View this message in context:
http://www.nabble.com/Error-0x8000ffff-when-using-nsIWebNavigations-APIs-tf3266065.html#a9078970
Sent from the Mozilla - XPCOM mailing list archive at Nabble.com.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom