dear list,
i am not able to register my pyxpcom component successfully. at first i have copied the xpi- and the py-file to the /components-directory and ran ./regxpcom. but whenever i tried to load it with xpcshell, i got the message that my component (@umc/nsIUmcTest;1) is not registered ("Invalid ClassID or ContractID").
(btw: i had no troubles registering and using a c++ and a js-component).
so i checked the registry-files (components/*.dat) and compared to the files in the Komodo-directory (Komodo also uses pyxpcom), and it seemed that regxpcom was not able to register the python library. that's not really a problem as i can register the components manually, so i added the following lines:
components/compreg.dat:
[CLASSIDS]
{ce32e3ff-36f8-425f-94be-d85b26e634ee},,script/python,,rel:nsIUmcTest.py[CONTRACTIDS]
@umc/nsIUmcTest;1,{ce32e3ff-36f8-425f-94be-d85b26e634ee}in components/xpti.dat there's the following line (generated by regxpcom, i guess):
[Interfaces,989]
630,nsIUmcTest,{ce32e3ff-36f8-425f-94be-d85b26e634ee},120,-1,1now when i run xpcshell, i no longer get the "Invalid ClassID or ContractID" error message, but the following error:
[EMAIL PROTECTED]:~/umclaw/mozilla> ./run-mozilla.sh ./xpcshell
js> const Simple=new Components.Constructor("@umc/nsIUmcTest;1", "nsIUmcTest");
js> var s=Simple();
:2: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
js>
i have no idea what this error means, maybe one of you has a hint? i really want to get this working...
thanks, Chris
PS: here are the sources of the idl- and the python-file:
---------------------------------------------------------
#include "nsISupports.idl"
[scriptable, uuid(ce32e3ff-36f8-425f-94be-d85b26e634ee)]
interface nsIUmcTest : nsISupports
{
attribute string yourName;
void write( );
void change(in string aValue);
};--------------------------------------------------------- import xpcom from xpcom import components
class nsIUmcTest:
_com_interfaces_ = xpcom.components.interfaces.nsIUmcTest
_reg_clsid_ = "{ce32e3ff-36f8-425f-94be-d85b26e634ee}"
_reg_contractid_ = "@umc/nsIUmcTest;1"
_reg_desc_ = "umc simple test" def __init__(self):
self.m_name='default name' def get_yourName( self ):
return self.m_name def set_yourName( self, param0 ):
self.m_name=param0 def write( self ):
print self.m_name def change( self, param0 ):
self.set_yourName(param0)
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom
