title: how to get return value from exe and restart it
body: <p><strong>Scenario:</strong> I have a MFC code  which call an exe created in C# (it is a windows form application)</p>
  
  <p><strong>Need:</strong>  I need that the exe would return a value when closed and on the basis of the return value the same exe will started again</p>
  
  <p>psudocode</p>
  
  <pre><code>  int result = RunExe("exename", arguments)
    if(result == 1)
    {
       result =  RunExe("exename", arguments)
    }
  </code></pre>
  
  <p>do I have to put the if condition  in loop?</p>
  
  <p>plz give me some suggestion.
  1.How to return a value from exe
  2. How to collect the return value
  3. How to restart the exe</p>