From:  fantasai <fantasai.lists@inkedblade.net>
Date:  18 Nov 2005 08:21:55 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.layout
Subject:  

Re: Viewer.exe asserts

NNTP-Posting-Host:  dynamic-oit-vapornet-b-823.Princeton.EDU

StuartX wrote:
> Ok, seems the XPCOM initialization method NS_InitXPCOM2/NS_InitXPCOM3
> get's called twice when starting up. I've changed the code in the
> viewer project to only get called once.
> 
> Change made to nsViewerApp.cpp:
> 
> nsresult
> nsViewerApp::SetupRegistry()
> {
>   nsresult rv;
> 
>   nsCOMPtr servManager;
> 
>   rv = NS_GetServiceManager(getter_AddRefs(servManager));
>   //rv = NS_InitXPCOM3(getter_AddRefs(servManager), nsnull, nsnull,
>   //                   kPStaticModules, kStaticModuleCount);
> 
>   nsCOMPtr registrar =
> do_QueryInterface(servManager);
>   NS_ASSERTION(registrar, "No nsIComponentRegistrar from get service.
> see dougt");
>   rv = registrar->AutoRegister(nsnull);
> 
>   // Register our browser window factory
>   nsIFactory* bwf;
>   NS_NewXPBaseWindowFactory(&bwf);
>   registrar->RegisterFactory(kXPBaseWindowCID, 0, 0, bwf);
>   NS_RELEASE(bwf);
> 
>   // register the cookie manager
>   nsCOMPtr cookieService =
>            do_GetService(kCookieServiceCID, &rv);
>   if (NS_FAILED(rv) || (nsnull == cookieService)) {
> #ifdef DEBUG
>     printf("Unable to instantiate Cookie Manager\n");
> #endif
>   }
> 
>   return NS_OK;
> }
> 
> Now I just have to figure out how to submit a defect change request...

http://bugzilla.mozilla.org ?

~fantasai