char * str = fileName.ToNewCString();
char * str = ToNewCString(fileName);
HandleLocationEvent(nsGUIEvent *aEvent){  nsEventStatus result = nsEventStatus_eIgnore;  nsBrowserWindow* bw =    nsBrowserWindow::FindBrowserFor(aEvent->widget, FIND_LOCATION);  if (nsnull != bw) {    switch (aEvent->message) {    case NS_KEY_UP:      if (NS_VK_RETURN == ((nsKeyEvent*)aEvent)->keyCode) {        nsAutoString text;        PRUint32 size;        bw->mLocation->GetText(text, 1000, size);        bw->GoTo(text.get());      }      break;    case NS_DRAGDROP_EVENT: {      /*printf("Drag & Drop Event\n");      nsDragDropEvent * ev = (nsDragDropEvent *)aEvent;      nsAutoString fileURL;      BuildFileURL(ev->mURL, fileURL);      nsAutoString fileName(ev->mURL);      char * str = fileName.ToNewCString();      PRInt32 len = strlen(str);      PRInt32 sum = len + sizeof(FILE_PROTOCOL);      char* lpszFileURL = new char[sum];        // Translate '\' to '/'      for (PRInt32 i = 0; i < len; i++) {        if (str[i] == '\\') {          str[i] = '/';        }      }      // Build the file URL      PR_snprintf(lpszFileURL, sum, "%s%s", FILE_PROTOCOL, str);      // Ask the Web widget to load the file URL      nsString urlStr(lpszFileURL);      const PRUnichar * uniStr = fileURL.get();      bw->GoTo(uniStr);      //delete [] lpszFileURL;      //delete [] str;*/      } break;    default:      break;    }    NS_RELEASE(bw);  }  return result;}