return rv;
if (!sRegistryInitializedFlag) {  NS_SetupRegistry();  rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, NULL ); if (NS_OK != rv) { NS_ASSERTION(PR_FALSE, "Could not AutoRegister"); return rv; }  sRegistryInitializedFlag = PR_TRUE; }       nsIEventQueueService* eventQService = NULL; rv = nsServiceManager::GetService(kEventQueueServiceCID, NS_GET_IID(nsIEventQueueService), (nsISupports **)&eventQService); if (NS_SUCCEEDED(rv)) { rv = eventQService->CreateThreadEventQueue(); nsServiceManager::ReleaseService(kEventQueueServiceCID, eventQService); }  #ifdef HACK_AROUND_THREADING_ISSUES  nsresult res; NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED (res) && (nsnull != sBundleService)) { nsCOMPtr<nsIStringBundle> stringBundle; char*  propertyURL = "chrome: nsILocale *locale = nsnull; res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(stringBundle)); } #endif  return NS_OK;
nsresult NS_InitEmbedding(const char *aPath){	// Create an object to represent the path	nsILocalFile *localFile = nsnull;	if (aPath && strlen(aPath) > 0)	{		NS_NewLocalFile(aPath, &localFile);	}    nsresult rv = NS_InitEmbedding(localFile);    NS_IF_RELEASE(localFile);    return rv;}