Hi
I try to call a XPCOM-Interface function:
var iface = Components.interfaces.nsIMessenger var inst = Components.classes["@mozilla.org/messenger;1"].getService(iface); inst.OpenURL("http://www.google.com");
But I allways get the following error:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIMessenger.OpenURL]" nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)" location: "JS frame :: chrome://test/content/test.js :: test :: line 34" data: no]
Where is the fault in this code?
I have no idea how you are supposed to use this API - or even if it is appropriate for what you are trying to do.
But, the error message indicates that this is the result of the third line of the excerpt you show; i.e. it is the result of making the call to nsIMessenger.OpenURL, rather than a failure to get the service in the previous line.
I assume this would be calling the nsMessenger::OpenURL method at: http://lxr.mozilla.org/seamonkey/source/mailnews/base/src/nsMessenger.cpp#553
The only thing I see there that would be likely to give that error code is the call to GetMessageServiceFromURI. I quick look at that code suggest that you are probably not using this API as it was intended to be used. I have to guess that if what you are trying to do is open google in a window then the messagenger is not the component to ask. Sorry I can't tell you exactly how to do whatever it is you are trying to do.
John.
