LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2010, 06:34 AM   #1
niteshkumar
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Problem in Registartion of XPCOM Component


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 .
 
Old 01-05-2010, 12:41 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,258

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
Quote:
Originally Posted by niteshkumar View Post
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 .
I'll suggest you don't post the same question twice, within a few minutes of each other.
 
Old 01-06-2010, 08:03 AM   #3
niteshkumar
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Re:Problem in XPCOM Component Registration

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


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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox 3.0.2 not starting up, Error[Couldn't load XPCOM] harry2006 Linux - Software 6 04-06-2011 03:49 PM
Registration of XPCOM Components niteshkumar Linux - Newbie 0 01-04-2010 12:28 PM
mozilla xpcom and spidermonkey sschegondi Linux - Software 1 02-04-2009 05:54 AM
mozilla xpcom and spidermonkey sschegondi Linux - Newbie 0 02-03-2009 12:57 PM
Realplayer Registartion pop up! d46-7 Linux - Software 5 04-07-2004 03:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration