rv = OpenWindow((const char *)chromeUrlForTask, defaultArgs);
rv = OpenWindow(chromeUrlForTask, defaultArgs);
static nsresult LaunchApplicationWithArgs(const char *commandLineArg, nsICmdLineService *cmdLineArgs, const char *contractID, PRInt32 height, PRInt32 width){  if (!contractID || !commandLineArg || !cmdLineArgs)    return NS_ERROR_FAILURE;  nsresult rv;  nsCOMPtr <nsICmdLineHandler> handler(do_GetService(contractID, &rv));  if (NS_FAILED(rv)) return rv;  if (!handler) return NS_ERROR_FAILURE;  nsXPIDLCString chromeUrlForTask;  rv = handler->GetChromeUrlForTask(getter_Copies(chromeUrlForTask));  if (NS_FAILED(rv)) return rv;#ifdef DEBUG_CMD_LINE  printf("XXX got this one:\t%s\n\t%s\n\n",commandLineArg,(const char *)chromeUrlForTask);#endif /* DEBUG_CMD_LINE */  nsXPIDLCString cmdResult;  rv = cmdLineArgs->GetCmdLineValue(commandLineArg, getter_Copies(cmdResult));  if (NS_FAILED(rv)) return rv;#ifdef DEBUG_CMD_LINE  printf("%s, cmdResult = %s\n",commandLineArg,(const char *)cmdResult);#endif /* DEBUG_CMD_LINE */  PRBool handlesArgs = PR_FALSE;  rv = handler->GetHandlesArgs(&handlesArgs);  if (handlesArgs) {    if ((const char *)cmdResult) {      if (PL_strcmp("1",(const char *)cmdResult)) {        PRBool openWindowWithArgs = PR_TRUE;        rv = handler->GetOpenWindowWithArgs(&openWindowWithArgs);        if (NS_FAILED(rv)) return rv;        if (openWindowWithArgs) {          nsString cmdArgs; cmdArgs.AssignWithConversion(NS_STATIC_CAST(const char *, cmdResult));#ifdef DEBUG_CMD_LINE          printf("opening %s with %s\n",(const char *)chromeUrlForTask,"OpenWindow");#endif /* DEBUG_CMD_LINE */          rv = OpenWindow((const char *)chromeUrlForTask, cmdArgs.GetUnicode());        }        else {#ifdef DEBUG_CMD_LINE          printf("opening %s with %s\n",(const char *)cmdResult,"OpenChromeURL");#endif /* DEBUG_CMD_LINE */          rv = OpenChromeURL((const char *)cmdResult,height, width);          if (NS_FAILED(rv)) return rv;        }      }      else {        nsXPIDLString defaultArgs;        rv = handler->GetDefaultArgs(getter_Copies(defaultArgs));        if (NS_FAILED(rv)) return rv;        rv = OpenWindow((const char *)chromeUrlForTask, defaultArgs);        if (NS_FAILED(rv)) return rv;      }    }  }  else {    if (NS_SUCCEEDED(rv) && (const char*)cmdResult) {      if (PL_strcmp("1",(const char *)cmdResult) == 0) {        rv = OpenChromeURL((const char *)chromeUrlForTask,height, width);        if (NS_FAILED(rv)) return rv;      }      else {        rv = OpenChromeURL((const char *)cmdResult, height, width);        if (NS_FAILED(rv)) return rv;      }    }  }  return NS_OK;}