LONG r = (LONG) ::ShellExecute( NULL, "open", (const char *) path, NULL, NULL, SW_SHOWNORMAL); if (r < 32) { rv = NS_ERROR_FAILURE; } else rv = NS_OK;
command =  (const char *)mAppRegistryName; command += " "; command += (const char *)path;  #ifdef DEBUG_seth printf("spawn this: %s\n",(const char *)command); #endif int err = system((const char *)command);  if (err == 0) { rv = NS_OK; } else { rv = NS_ERROR_FAILURE; }
nsresult nsExternalApplication::LaunchApplication(nsIFile * aTempFile){  nsresult rv = NS_OK;  if (!mAppRegistryName.IsEmpty() && aTempFile)  {    nsXPIDLCString path;    aTempFile->GetPath(getter_Copies(path));        // use the app registry name to launch a shell execute....    LONG r = (LONG) ::ShellExecute( NULL, "open", (const char *) path, NULL, NULL, SW_SHOWNORMAL);    if (r < 32)     {			rv = NS_ERROR_FAILURE;		}		else			rv = NS_OK;  }  return rv;}