nsCOMPtr<nsIPref> pPref(do_GetService(kPrefCID, &rv));
nsCOMPtr<nsIPref> pPref(do_GetService(NS_PREF_CONTRACTID, &rv));
static char *DIR_GetLocalizedStringPref(const char *prefRoot, const char *prefLeaf, char *scratch, const char *defaultValue){    nsresult rv = NS_OK;    nsCOMPtr<nsIPref> pPref(do_GetService(kPrefCID, &rv));     if (NS_FAILED(rv) || !pPref) 		return nsnull;	PL_strcpy(scratch, prefRoot);	PL_strcat(scratch, ".");	PL_strcat(scratch, prefLeaf);	nsXPIDLString wvalue;	rv = pPref->GetLocalizedUnicharPref(scratch, getter_Copies(wvalue));	char *value = nsnull;	if ((const PRUnichar*)wvalue)	{		nsString descString(wvalue);		PRInt32 unicharLength = descString.Length();		// convert to UTF8 string		INTL_ConvertFromUnicode(wvalue, unicharLength, &value);	}	else        value = defaultValue ? nsCRT::strdup(defaultValue) : nsnull;	return value;}