Hi Damien,

I did the steps you said in your mail and see compreg.dat recreated under profiles directory.

But, the observer notification for xpcom-startup didn't came while firefox starts.

The following code registers for the xpcom-startup notification
to category manager

static NS_METHOD nsQEngineRegistrationProc(nsIComponentManager *aCompMgr,
                                          nsIFile *aPath,
                                          const char *registryLocation,
                                          const char *componentType,
                                          const nsModuleComponentInfo *info)
{
    nsresult rv;
    nsCOMPtr<nsIServiceManager> server = do_QueryInterface((nsISupports*)aCompMgr,&rv);
    nsCOMPtr<nsICategoryManager> catman;
    server->GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,NS_GET_IID(nsICategoryManager),getter_AddRefs(catman));
    if(NS_SUCCEEDED(rv))
    {
        char* previous = nsnull;
        catman->AddCategoryEntry("xpcom-startup","nsQEngineImpl",NS_QENGINE_CONTRACTID,PR_TRUE,PR_TRUE,&previous);
    }
   
    return NS_OK;
}



Please let me know this is the way by which we should register for xpcom-startup notification.

One more pointer the same code works with Firefox under Linux Platform.

I will appreciate your help in this regard.

Thanks & Regards
Raghavan


Damien O'Brien wrote:
Message
Hi,
Yes this did work for me. The steps are as follows
 
1) Shutdown any running instances of Firefox
2) Copy your dll into the components folder (C:\Program Files\Mozilla Firefox\components)
3) "Touch" e.g. open and save the file .autoreg - You will find this in the same folder as firefox.exe (C:\Program Files\Mozilla Firefox)
4) Restart Firefox.
 
Once you've done this you should be able to use your dll (depending on what it does).
 
According to Doug Turner in that link I sent you there are a number of other ways of doing this;
 
A) touch a file .autoreg next to the executable.
B) run regxpcom with the right commands.
C) install the component via xpinstall.
D) run some priveleged js (as your code above attempts to do)
I tried using regxpcom to do this but like you this didn't work for me. I haven't tried using xpinstall.
 
If you mange to figure out another way of doing this I'd appreciate you sending it on to me ;-)
Thanks,
 Damien
--
"Buy what you want. Sell what you don't want. Use this portal, www.finepick.com, for FREE. Simple!"

Reply via email to