Craig Kadziolka wrote:
Hi,

I am trying to implement the nsIURIContentListener interface and get it registered so I can closely monitor URI changes before the location is changed. I have added this interface to my "Chrome" class and basically stubbed out all the methods. I then registered the interface using SetParentURIContentListener. After that I put breakpoints on all the methods included in nsIURIContentListener but none of them seem to be called, even when the user clicks on a URL.

I am using Mozilla checked out of CVS about a week ago, since I had problems getting older release versions building with my compiler (VC++ 2005 express).

My main initialization looks like this (error checking removed to be concise):

     NS_InitEmbedding(nsnull, nsnull);

   nsCOMPtr<nsIComponentRegistrar> registrar;
   nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
   if (NS_FAILED(rv)) return false;
   rv = registrar->AutoRegister(nsnull);

   mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
   mBaseWindow = do_QueryInterface(mWebBrowser, &rv);

   chrome = new TestChrome();
   chrome->AddRef();
mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, chrome)); mWebBrowser->SetParentURIContentListener(NS_STATIC_CAST(nsIURIContentListener *, chrome));
I have done some more digging and found that the call to SetParentURIContentListener() is failing with rv = 80004005, so that seems to be my core problem. Does anyone know why the registration may fail in that way?

Thanks,

Craig.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to