nsComponentManager::RegisterComponent(kMimeURLUtilsCID,  NULL, NULL, MIME_DLL, PR_FALSE, PR_FALSE);
int main(int argc, char *argv[]) {   nsresult rv = NS_OK;	nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);	nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);	nsComponentManager::RegisterComponent(kPrefCID, nsnull, nsnull, PREF_DLL, PR_TRUE, PR_TRUE);	nsComponentManager::RegisterComponent(kFileLocatorCID,  NULL, NS_FILELOCATOR_PROGID, APPSHELL_DLL, PR_FALSE, PR_FALSE);	nsComponentManager::RegisterComponent(kMimeURLUtilsCID,  NULL, NULL, MIME_DLL, PR_FALSE, PR_FALSE);	nsComponentManager::RegisterComponent(kNetSupportDialogCID,  NULL, NULL, APPSHELL_DLL, PR_FALSE, PR_FALSE);  // Create the Event Queue for this thread...	NS_WITH_SERVICE(nsIEventQueueService, pEventQService, kEventQueueServiceCID, &rv); 	if (NS_FAILED(rv))   {    printf("Failed to get event queue\n");    return rv;  }  rv = pEventQService->CreateThreadEventQueue();	if (NS_FAILED(rv))   {    printf("Failed to create event queue\n");    return rv;  }	// 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, &rv);     if (NS_FAILED(rv) || (prefs == nsnull)) {        exit(rv);    } if (NS_FAILED(prefs->ReadUserPrefs())) {   printf("Failed on reading user prefs!\n");   exit(-1); }  nsCOMPtr<nsIMsgIdentity>  identity = nsnull;    NS_WITH_SERVICE(nsIMsgAccountManager, accountManager, NS_MSGACCOUNTMANAGER_PROGID, &rv);  if (NS_FAILED(rv))   {    printf("Failure getting Mail Session!\n");    return rv;  }    rv = accountManager->GetCurrentIdentity(getter_AddRefs(identity));  if (NS_FAILED(rv))   {    printf("Failure getting Identity!\n");    return rv;  }      nsCOMPtr<nsIMsgSendLater> pMsgSendLater;  rv = nsComponentManager::CreateInstance(kMsgSendLaterCID, NULL, kIMsgSendLaterIID,                                           (void **) getter_AddRefs(pMsgSendLater));   if (NS_SUCCEEDED(rv) && pMsgSendLater)   {     printf("We succesfully obtained a nsIMsgSendLater interface....\n");        pMsgSendLater->SendUnsentMessages(identity, nsnull);  }#ifdef XP_PC  printf("Sitting in an event processing loop ...Hit Cntl-C to exit...");  while (1)  {    MSG msg;    if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))    {      TranslateMessage(&msg);      DispatchMessage(&msg);    }  }#endif  return 0; }