printf("unable to get event queue.\n");
PRINTF("unable to get event queue.\n");
int main(){    nsIEventQueue *queue;    nsresult result;	nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);	nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);	result = nsComponentManager::RegisterComponent(kPrefCID, nsnull, nsnull, PREF_DLL, PR_TRUE, PR_TRUE);	nsComponentManager::RegisterComponent(kFileLocatorCID,  NULL, NS_FILELOCATOR_CONTRACTID, APPSHELL_DLL, PR_FALSE, PR_FALSE);	result = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, NULL /* default */);	// make sure prefs get initialized and loaded..	// mscott - this is just a bad bad bad hack right now until prefs	// has the ability to take nsnull as a parameter. Once that happens,	// prefs will do the work of figuring out which prefs file to load...	NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &result);     if (NS_FAILED(result) || (prefs == nsnull)) {        exit(result);    }	prefs->StartUp();    if (NS_FAILED(prefs->ReadUserPrefs()))    {      printf("Failed on reading user prefs!\n");      exit(-1);    }	// Create the Event Queue for this thread...	NS_WITH_SERVICE(nsIEventQueueService, pEventQService, kEventQueueServiceCID, &result); 	if (NS_FAILED(result)) return result;    result = pEventQService->CreateThreadEventQueue();	if (NS_FAILED(result)) return result;    result = pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD,&queue);    if (NS_FAILED(result) || !queue) {        printf("unable to get event queue.\n");        return 1;    }	// okay, everything is set up, now we just need to create a test driver and run it...	nsSmtpTestDriver * driver = new nsSmtpTestDriver(queue);	if (driver)	{		NS_ADDREF(driver);		driver->RunDriver();		// when it kicks out...it is done....so delete it...		NS_RELEASE(driver);	}	NS_IF_RELEASE(queue);    return NS_OK;}