nsIMailboxService* mailboxService; rv = nsServiceManager::GetService(kCMailboxServiceCID, nsIMailboxService::GetIID(), (nsISupports**)&mailboxService);
NS_WITH_SERVICE(nsIMailboxService, mailboxService, kCMailboxServiceCID, &rv);
nsresult nsMailboxTestDriver::OpenMailbox(){	nsresult rv = NS_OK; 	char * displayString = nsnull;	PL_strcpy(m_userData, (const char *) m_folderSpec);	// ask for path to local mailbox folders	displayString = PR_smprintf("Location of mailbox folders [%s]: ", m_userData);	rv = PromptForUserDataAndBuildUrl(displayString);	PR_FREEIF(displayString);	char * folderPath = PL_strdup(m_userData);	// now ask for the mailbox name...	PL_strcpy(m_userData, DEFAULT_MAILBOX);	displayString = PR_smprintf("Mailbox to parse [%s]: ", m_userData);	rv = PromptForUserDataAndBuildUrl(displayString);	PR_FREEIF(displayString);	// concatenate folder name onto folder path....	char * fullFolderPath = PR_smprintf("%s%c%s", folderPath ? folderPath : "",PR_DIRECTORY_SEPARATOR, m_userData);	PR_FREEIF(folderPath);	// now turn this into a nsFileSpec...	nsFileSpec filePath(fullFolderPath);	PR_FREEIF(fullFolderPath);	// now ask the mailbox service to parse this mailbox...    nsIMailboxService* mailboxService;    rv = nsServiceManager::GetService(kCMailboxServiceCID,                                      nsIMailboxService::GetIID(),                                      (nsISupports**)&mailboxService);	if (NS_SUCCEEDED(rv) && mailboxService)	{		nsIURL * url = nsnull;		mailboxService->ParseMailbox(filePath, m_mailboxParser, this /* register self as url listener */, &url);		if (url)			url->QueryInterface(nsIMailboxUrl::GetIID(), (void **) &m_url);		NS_IF_RELEASE(url);        (void)nsServiceManager::ReleaseService(kCMailboxServiceCID, mailboxService);	}	else		NS_ASSERTION(PR_FALSE, "unable to acquire a mailbox service...registration problem?");	return rv;}