From:  "Cotas" <ckchuang@hotmail.com>
Date:  26 Jul 2006 12:39:53 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.jseng
Subject:  

using XPCOM object in SpiderMonkey script

NNTP-Posting-Host:  203.173.151.199

Hi,

I want to add javascripting support into my application (Win32 MFC)
with SpiderMonkey. I've got to a stage where I could call JS function
and handle callback with JSApi. However, I want to be able to expose
more my application's functionality to javascript that is similiar to
DOM fashion. After reading around in the forum, I saw various
suggestion on using XPCOM and XPConnect.

After successfully built a XPConnect standalone, and went through a
small tutorial (http://www.iosart.com/firefox/xpcom/) on how to build a
XPCOM component and register it with FireFox successfully. Now I want
to apply this idea to my code. However, I now have the following
question:

If I implemented several XPCOM interfaces in my application (a single
exe file), I guess I need to register these XPCOM interfaces with
"something" before I could reference these in the javascript that I
will be calling with SpiderMonkey (in the same exe)? Do I register it
like the other XPCOM object (put my app.exe into the component
directory and called the regxpcom.exe), or do I register these with the
SpiderMonkey's JSContext?

Also, is there any documentation on the XPConnect?

I would appreciate any help!  Thanks in advance!


Cotas
=-=-=--==-=-=--==-