printf("ERROR at GetService() code=0x%x.\n",res);
fprintf(stderr, "ERROR at GetService() code=0x%x.\n",res);
SetupRegistry(void){  // i18n  nsComponentManager::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UNICHAR_DLL,  PR_FALSE, PR_FALSE);  nsresult res = nsServiceManager::GetService(kCharsetConverterManagerCID, NS_GET_IID(nsICharsetConverterManager), (nsISupports **)&ccMan);  if (NS_FAILED(res))   {    printf("ERROR at GetService() code=0x%x.\n",res);    return NS_ERROR_FAILURE;  }  // netlib    // xpcom  static NS_DEFINE_CID(kMemoryCID,  NS_MEMORY_CID);  static NS_DEFINE_CID(kEventQueueCID, NS_EVENTQUEUE_CID);  nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL,  PR_FALSE, PR_FALSE);  nsComponentManager::RegisterComponent(kEventQueueCID,        NULL, NULL, XPCOM_DLL,  PR_FALSE, PR_FALSE);  nsComponentManager::RegisterComponent(kGenericFactoryCID,    NULL, NULL, XPCOM_DLL,  PR_FALSE, PR_FALSE);  nsComponentManager::RegisterComponent(kMemoryCID,            NULL, NULL, XPCOM_DLL,  PR_FALSE, PR_FALSE);  // prefs  nsComponentManager::RegisterComponent(kPrefCID,              NULL, NULL, PREF_DLL,  PR_FALSE, PR_FALSE);  return NS_OK;}