Open compreg.dat in the profile directory with a text editor. Search the file for the UUIDs of your interfaces/components. If they aren't in the file,the registration code failed.


----- Original Message ----
From: alex
To: dev-extensions@lists.mozilla.org
Sent: Tuesday, December 5, 2006 11:32:17 AM
Subject: How to have my xpcom component initialtes when mozilla is starting?

Hello,

These days I'mtrying to build a simple xpcom component in c++ and package
it into xpi file, then install it as extention of firefox. This extension
will createan item on BrowserToolbarPalette and it will call method on my
componentthrough javascript.

The installation seems work, I can install my extension, but when I'm trying
to call it, there is error returned. Firstly,I can't find the component
with XPCOMViewer (should I?), and when I try to initialte the component in
javascript as:
const cid = "@my.com/MySample/Simple;1";
obj = Components.classes[cid].createInstance();

It returns error:
TypeError: Components.classes[cid] has no properties.

It seems the component doesn't initiated when mozilla is started.
Referencing weblock example on mozilla xpcom doc site, I have my component
implemented nsIObserver interface, and in the component cpp file I have
methods

static NS_METHOD WebLockRegistration(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
and

static NS_METHOD WebLockUnregistration(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const nsModuleComponentInfo *info)

As weblock example said this method would be able to register the component
as xpcom-start observer, sowho's calling these methods?

Can I auto start my component packaged with xpi file?

Thanks in advance.
Alex.


_______________________________________________
dev-extensions mailing list
dev-extensions@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions






__________________________________________________ __________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com