Could anybody give any hints? I made a Mozilla 1.4 debug build and tried to debug it, but it always failed in some other places. I still didn't get the right cause. :-( Any inputs ?

Thanks,
-George.
Hi all,

I'm adding below code to mfcembed.exe for profile management. Which works with Mozilla 1.4 through 1.8a4 .zip packages, and 1.6 through 1.8a4 .exe package (mfcembed was copied to the GRE directory). But it failed with 1.4.x .exe package in below line:
>   return svcMgr->GetServiceByContractID(aContractID, aIID, aResult);
with error code: 80004005. From nsError.h ...
> /* Returned when a function fails */
> 182 #define NS_ERROR_FAILURE                   ((nsresult) 0x80004005L)

nsresult InitializeProfile()
{......
   nsCOMPtr<nsIPrefService> pref;
   rv = GetService("@mozilla.org/preferences-service;1",
                   NS_GET_IID(nsIPrefService),
                   getter_AddRefs(pref));
}
nsresult GetService(const char *aContractID, const nsIID &aIID, void **aResult)
{
   nsCOMPtr<nsIServiceManager> svcMgr;
   nsresult rv = NS_GetServiceManager(getter_AddRefs(svcMgr));
   if (NS_FAILED(rv)) return rv;

// Faiilure in below line with error code: 80004005
   return svcMgr->GetServiceByContractID(aContractID, aIID, aResult);
}

Other calls succeed like:
> rv = GetService("@mozilla.org/network/protocol;1?name=http",
                    NS_GET_IID(nsIHttpProtocolHandler),
                    getter_AddRefs(httpHandler));

Why ONLY below call
> rv = GetService("@mozilla.org/preferences-service;1",
                   NS_GET_IID(nsIPrefService),
                   getter_AddRefs(pref));
failed and only with 1.4 .exe package installation ?  I find this line "@mozilla.org/preferences-service;1,{1cd91b88-1dd2-11b2-92e1-ed22ed298000}" in compreg.dat of Mozilla 1.4 .exe GRE directory.

I'm quite confused. Comments are much appreciated !
-George.
https://jdic.dev.java.net

Reply via email to