Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
Linux in General => Linux Development & Programming => Topic started by: niteshkumar on January 05, 2010, 05:56:19 AM
-
The component which i was built with gecko-sdk 1.9 (xulrunner-1.9.0.14.en-US.linux-i686.sdk.tar.bz2) on firefox 3.5 But when I tried my component with gecko-sdk 1.9 it fails to register (entry is not appeared in compreg.dat but appears in xpti.dat) on linux.
i take the sample example given in the http://www.iosart.com/firefox/xpcom
but the problem is when i tried to run the application fails with a "TypeError: Components.classes[cid] is undefined" error.
if any suggestion come i will appreciate it.
thanks in advance .
-
The component which i was built with gecko-sdk 1.9 (xulrunner-1.9.0.14.en-US.linux-i686.sdk.tar.bz2) on firefox 3.5.6 But when I tried my component with gecko-sdk 1.9 it fails to register (entry is not appeared in compreg.dat but appears in xpti.dat) on linux.(fedora)
i take the sample example given in the http://www.iosart.com/firefox/xpcom
but the problem is when i tried to run the application fails with a "TypeError: Components.classes[cid] is undefined" error.
I am followed the same example given in http://www.iosart.com/firefox/xpcom and able to make MyComponent.so file using make file
i also copied my .so and .xpt file to /usr/lib/firefox-3.5.6/components folder.
after that i registered through regxpcom command .but it entry appears in xpti.dat (here interface and .xpt file i found ) but the .so and Components not appeared in compreg.dat)
This is MyComponentTest.js file
function MyComponentGo() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const cid = "@nitesh.org/MyComponent;1";
obj = Components.classes[cid].createInstance();
obj = obj.QueryInterface(Components.interfaces.IMyComponent);
} catch (err) {
alert(err);
return;
}
var res = obj.Add(3, 4);
alert('Performing 3+4. Returned ' + res + '.');
}
This is my html file
<HTML>
<SCRIPT SRC="MyComponentTest.js"></SCRIPT>
<BODY>
<BUTTON ONCLICK="MyComponentGo();">Go</BUTTON>
</BODY>
</HTML>
when i m trying to run my html file it is saying
JavaScript Application
TypeError: Components.classes[cid] is undefined