PL_strcpy(IspPhone[PhoneCount], v.ToNewCString()); char* value = v.ToNewCString();
char* value = ToNewCString(v); PL_strcpy(IspPhone[PhoneCount], value);
int nsAccount::GetNCIValues(nsString MiddleValue){	  nsresult ret;  nsIInputStream* in = nsnull;	nsString Trial; Trial.AssignWithConversion("resource:/res/acct/NCI_Dir/");	Trial = Trial + MiddleValue;	printf("this is the trial value %s \n", Trial.ToNewCString());  nsCOMPtr<nsIIOService> service(do_GetService(kIOServiceCID, &ret));  if (NS_FAILED(ret)) return ret;  nsCOMPtr<nsIURI> uri;  ret = NS_NewURI(getter_AddRefs(uri), Trial, nsnull, service);  if (NS_FAILED(ret)) return ret;  nsIChannel *channel = nsnull;  ret = NS_OpenURI(&channel, uri, service);  if (NS_FAILED(ret)) return ret;  ret = channel->Open(&in);  if (NS_FAILED(ret)) return ret;  nsIPersistentProperties* props = nsnull;  ret = nsComponentManager::CreateInstance(kPersistentPropertiesCID, NULL,    kIPersistentPropertiesIID, (void**) &props);  if (NS_FAILED(ret) || (!props)) {    printf("create nsIPersistentProperties failed\n");    return 1;  }  ret = props->Load(in);  if (NS_FAILED(ret)) {    printf("cannot load properties\n");    return 1;  }  int ind = 1; //  while (1) {    char name[256];    name[0] = 0;    nsAutoString v;    sprintf(name, "%s", "SiteName");    ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);    if (NS_FAILED(ret) || (!v.Length())) {	printf("Failed to return the Get property \n");    }	PL_strcpy(IspLocation[LocCount], v.ToNewCString());	char* lvalue = v.ToNewCString();      cout << "the value is " << IspLocation[LocCount] << "." << endl;      delete[] lvalue;	LocCount++;    sprintf(name, "%s", "Phone");    ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);    if (NS_FAILED(ret) || (!v.Length())) {      	printf("Failed to return the Get property \n");    }	PL_strcpy(IspPhone[PhoneCount], v.ToNewCString());	char* value = v.ToNewCString();//    if (value) {      cout << "the value is " << IspPhone[PhoneCount] << "." << endl;//	  printf ("this is the %d and its value \n ",ind);      delete[] value;  	PhoneCount++;//    }//    else {//      printf("%d: ToNewCString failed\n", ind);//    }//    ind++;//  }    return 1;}