char * cStr = str.ToNewCString();
char * cStr = ToNewCString(str);
nsEventStatus PR_CALLBACK HandleRobotEvent(nsGUIEvent *aEvent){  nsEventStatus result = nsEventStatus_eIgnore;  if (aEvent == nsnull ||  aEvent->widget == nsnull) {    return result;  }  switch(aEvent->message) {    case NS_MOUSE_LEFT_BUTTON_UP: {      if (aEvent->widget->GetNativeData(NS_NATIVE_WIDGET) == GetWidgetNativeData(mCancelBtn)) {        NS_ShowWidget(mRobotDialog,PR_FALSE);      } else if (aEvent->widget->GetNativeData(NS_NATIVE_WIDGET) == GetWidgetNativeData(mStartBtn)) {        nsString str;        PRUint32 size;        mStopAfterTxt->GetText(str, 255, size);        char * cStr = str.ToNewCString();        sscanf(cStr, "%d", &gDebugRobotLoads);        if (gDebugRobotLoads <= 0) {          gDebugRobotLoads = 5000;        }        delete[] cStr;        mVerDirTxt->GetText(str, 255, size);        str.ToCString(gVerifyDir, (PRInt32)_MAX_PATH);        if (!strcmp(gVerifyDir,DEBUG_EMPTY)) {          gVerifyDir[0] = '\0';        }        PRBool state = PR_FALSE;        mUpdateChkBtn->GetState(state);        gVisualDebug = state ? PR_TRUE: PR_FALSE;      }       } break;        case NS_PAINT: #ifndef XP_UNIX        // paint the background        if (aEvent->widget == mRobotDialog ) {          nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext;          drawCtx->SetColor(aEvent->widget->GetBackgroundColor());          drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect));          return nsEventStatus_eIgnore;      }#endif      return nsEventStatus_eIgnore;      break;    default:      result = nsEventStatus_eIgnore;  } //switch  return result;}