gl_freak wrote:
> 
> Hi. you may be tired , busy or what ever but please take the time to answer
> !
> 
> If you take a close look at modules/libpref/src/prefapi (line 430) wou will
> find this code :
> 
>     if (!gMochaTaskState)
>         gMochaTaskState = PREF_GetJSRuntime();
> 
>     if (!gMochaContext)
>     {
>         gMochaContext = JS_NewContext(gMochaTaskState, 8192);  /* ???? What
> size? */
> 
> The call to PREF_GetJSRuntime(); is failing due to nsIJSRuntimeService not
> been registered  . Here is the PREF_GetJSRuntime function.
> 
> extern "C" JSRuntime* PREF_GetJSRuntime()
> {
>     nsresult rv;
> 
>     NS_WITH_SERVICE(nsIJSRuntimeService, rtsvc,
> "@mozilla.org/js/xpc/RuntimeService;1", &rv);
>     if (NS_FAILED(rv)) return nsnull;
> 
>     JSRuntime* rt;
>     rv = rtsvc->GetRuntime(&rt);
>     if (NS_FAILED(rv)) return nsnull;
> 
>     return rt;
> }
> 
> Can you tell me where does this service gets registered so i can do the call
> before it hits this function ? No need to say that i did grep on the source
> i cannot figure it myself.

It is in xpconnect (xpc3250.dll last I checked). You'll need the
JavaScript dll (js3250.dll) too. xpc3250.dll needs to be in the
components dir and have been autoregistered.

You make no mention of xpt files. some of the code you are
pulling in is going to need them. Even if you make no calls via
xpconnect I believe that some calls will be going through the
xpcom/proxy system and need info from one or another typelib.

You would do well to start with some working collection of stuff
like one of the embedding examples or the xpconnect standalone
rather than building up from scratch.

John.

Reply via email to