Clear Output/Debug window?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    Clear Output/Debug window?


    Does anyone know how to clear the window so it's easier to see the
    stuff you have listed with Debug.Write(xyz )?

    Bob Sweeney

  • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

    #2
    RE: Clear Output/Debug window?

    Try right-clicking inside the Output window and look at the context menu
    options.
    Peter
    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "Bob" wrote:
    >
    Does anyone know how to clear the window so it's easier to see the
    stuff you have listed with Debug.Write(xyz )?
    >
    Bob Sweeney
    >
    >

    Comment

    • Bob

      #3
      Re: Clear Output/Debug window?

      On Mar 22, 12:21 pm, Peter Bromberg [C# MVP]
      <pbromb...@yaho o.yabbadabbadoo .comwrote:
      Try right-clicking inside the Output window and look at the context menu
      options.
      Peter
      --
      Site: http://www.eggheadcafe.com
      UnBlog: http://petesbloggerama.blogspot.com
      Short urls & more: http://ittyurl.net
      >
      >
      >
      "Bob" wrote:
      >
      Does anyone know how to clear the window so it's easier to see the
      stuff you have listed with Debug.Write(xyz )?
      >
      Bob Sweeney- Hide quoted text -
      >
      - Show quoted text -
      I mean programmaticall y so I can see my Debug.Write results


      Comment

      • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

        #4
        Re: Clear Output/Debug window?

        Programmaticall y, you need to work with the DTE80 assembly which comes in
        either COM or .NET flavors. I don't know exactly how to do it, but there are
        plenty of code samples on MSDN to get you started.
        Peter
        --
        Site: http://www.eggheadcafe.com
        UnBlog: http://petesbloggerama.blogspot.com
        Short urls & more: http://ittyurl.net




        "Bob" wrote:
        On Mar 22, 12:21 pm, Peter Bromberg [C# MVP]
        <pbromb...@yaho o.yabbadabbadoo .comwrote:
        Try right-clicking inside the Output window and look at the context menu
        options.
        Peter
        --
        Site: http://www.eggheadcafe.com
        UnBlog: http://petesbloggerama.blogspot.com
        Short urls & more: http://ittyurl.net



        "Bob" wrote:
        Does anyone know how to clear the window so it's easier to see the
        stuff you have listed with Debug.Write(xyz )?
        Bob Sweeney- Hide quoted text -
        - Show quoted text -
        >
        I mean programmaticall y so I can see my Debug.Write results
        >
        >
        >

        Comment

        • Zytan

          #5
          Re: Clear Output/Debug window?

          Does anyone know how to clear the window so it's easier to see the
          stuff you have listed with Debug.Write(xyz )?
          You can't programmaticall y. I know, it sucks. Best to make a logger
          and use that instead. Although, sometimes the Output window info is
          useful, so its not a complete waste. But, for general debugging it
          pretty much is.

          I wonder if you can just create a console, like in Win32 apps? And
          use that? That'd be the easiest solution, I imagine. But, last I
          heard you couldn't instantiate Console in .NET 2.0 or later.

          Zytan

          Comment

          • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

            #6
            Re: Clear Output/Debug window?

            Zytan,
            This is inaccurate. With the EnvDTE80 namespace you have programmatic access
            to all of the IDE, its windows, and their contents:






            -- Peter
            Site: http://www.eggheadcafe.com
            UnBlog: http://petesbloggerama.blogspot.com
            Short urls & more: http://ittyurl.net




            "Zytan" wrote:
            Does anyone know how to clear the window so it's easier to see the
            stuff you have listed with Debug.Write(xyz )?
            >
            You can't programmaticall y. I know, it sucks. Best to make a logger
            and use that instead. Although, sometimes the Output window info is
            useful, so its not a complete waste. But, for general debugging it
            pretty much is.
            >
            I wonder if you can just create a console, like in Win32 apps? And
            use that? That'd be the easiest solution, I imagine. But, last I
            heard you couldn't instantiate Console in .NET 2.0 or later.
            >
            Zytan
            >
            >

            Comment

            • Laura T.

              #7
              Re: Clear Output/Debug window?

              Yup. This works. But is it worth of it?

              private void ClearOutput()
              {
              EnvDTE80.DTE2 ide =
              (EnvDTE80.DTE2) System.Runtime. InteropServices .Marshal.GetAct iveObject("Visu alStudio.DTE.8. 0");
              ide.ExecuteComm and("Edit.Clear OutputWindow"," ");
              System.Runtime. InteropServices .Marshal.Releas eComObject(ide) ;
              }

              "Peter Bromberg [C# MVP]" <pbromberg@yaho o.yabbadabbadoo .comha scritto nel
              messaggio news:E4C7A3F8-3ADA-4B00-8ABF-5A1039D12E93@mi crosoft.com...
              Zytan,
              This is inaccurate. With the EnvDTE80 namespace you have programmatic
              access
              to all of the IDE, its windows, and their contents:
              >


              >
              >
              >
              -- Peter
              Site: http://www.eggheadcafe.com
              UnBlog: http://petesbloggerama.blogspot.com
              Short urls & more: http://ittyurl.net
              >
              >
              >
              >
              "Zytan" wrote:
              >
              Does anyone know how to clear the window so it's easier to see the
              stuff you have listed with Debug.Write(xyz )?
              >>
              >You can't programmaticall y. I know, it sucks. Best to make a logger
              >and use that instead. Although, sometimes the Output window info is
              >useful, so its not a complete waste. But, for general debugging it
              >pretty much is.
              >>
              >I wonder if you can just create a console, like in Win32 apps? And
              >use that? That'd be the easiest solution, I imagine. But, last I
              >heard you couldn't instantiate Console in .NET 2.0 or later.
              >>
              >Zytan
              >>
              >>

              Comment

              • Zytan

                #8
                Re: Clear Output/Debug window?

                This is inaccurate. With the EnvDTE80 namespace you have programmatic access
                to all of the IDE, its windows, and their contents:
                >
                http://msdn2.microsoft.com/en-us/lib...te(VS.80).aspx
                I thought you could, but not from C#, which is what I meant. But, I
                see that you can from C#, as Laura has shown with the content you
                provided.

                Zytan

                Comment

                • Zytan

                  #9
                  Re: Clear Output/Debug window?

                  Yup. This works. But is it worth of it?
                  >
                  private void ClearOutput()
                  {
                  EnvDTE80.DTE2 ide =
                  (EnvDTE80.DTE2) System.Runtime. InteropServices .Marshal.GetAct iveObject("Visu ­alStudio.DTE.8 .0");
                  ide.ExecuteComm and("Edit.Clear OutputWindow"," ");
                  System.Runtime. InteropServices .Marshal.Releas eComObject(ide) ;
                  }
                  Thanks for the example, Laura.

                  What do you imply by your question? I have one question, and maybe
                  this is what you are getting at: Is there any reason why the Output
                  Windows is NOT cleared? I'd prefer it cleared every time. Oh, wait,
                  I think I know why: because you'll clear the start-up logging of the
                  process. We actually want it to be cleared BEFORE that, so that only
                  the current run is shown in the window. Yeah, so this is why it is
                  likely not worth it. And thus, a logger is a better idea.

                  Zytan

                  Comment

                  • Zytan

                    #10
                    Re: Clear Output/Debug window?

                    We actually want it to be cleared BEFORE that, so that only
                    the current run is shown in the window.
                    Actually, only the current execution is shown in the Output Window.
                    So all is ok.

                    I was certain that before this wasn't the case. I think I was
                    thinking about how it works in VB, which is quite different.

                    Zytan

                    Comment

                    Working...