"Markus Hossner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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? > > Thanks > > Markus >
Hello Markus, I believe I had the same issue a while ago. There are some issues between versions of the tree. For example I created my XPCOM successfully the way you described using build 1.3. But I was unable to get the same result when I moved the exact same code to Mozilla 1.02 (Netscape build). I found that there are about umpteen different ways to construct the XPCOM interface or if you want it to act as a service or a regular interface. Actually Scott Collins pointed me to a good article on the subject. http://www.mozilla.org/scriptable/components_object.html This is how I had to instantiate my interface for 1.02 build and instantiating on Netscape 7.x. // global var xpcomInterface;
