System.Diagnostic help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • babai28
    New Member
    • Jul 2008
    • 59

    System.Diagnostic help

    Hi,
    I am trying to run the html help compiler "hhc.exe" from my C# application. I am providing a .hhc,.hhk and .hhp file to create .chm file. On running the code the .chm file is being created, however a command prompt like (black) window is also appearing displaying the compilation status.
    I want to suppress the window and to display the status (that it shows) in a control of my application. I guess, I am overlooking some property of the process class.
    Any help will be appreciated.

    Best regards,
    Sid
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Use

    Code:
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    p.Start();
    String output = p.StandardOutput.ReadToEnd();
    You can then set the output to your controls.

    Comment

    • babai28
      New Member
      • Jul 2008
      • 59

      #3
      Originally posted by r035198x
      Use

      Code:
      p.StartInfo.UseShellExecute = false;
      p.StartInfo.RedirectStandardOutput = true;
      p.Start();
      String output = p.StandardOutput.ReadToEnd();
      You can then set the output to your controls.
      Thank you very much my Friend. This looks very fine. The point is I am running the process code in a different thread altogether and the lines of the compilation status which will be achieved by:
      Code:
      string output = p.StandardOutput.ReadToEnd();
      will read all the output text of the process and diplay it in the control at one go.
      The requirement is updating the control on continuous basis as the compilation proceeds.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        You need to start another thread for reading the output then (perhaps another for reading the error stream as well.)
        Details are explained in this article.

        Comment

        • babai28
          New Member
          • Jul 2008
          • 59

          #5
          Originally posted by r035198x
          You need to start another thread for reading the output then (perhaps another for reading the error stream as well.)
          Details are explained in this article.
          Thanx a lot brother!
          The purpose is solved!

          Regards,
          Sid

          Comment

          Working...