PC Review


Reply
Thread Tools Rating: Thread Rating: 4 votes, 3.00 average.

Clear Output/Debug window?

 
 
Bob
Guest
Posts: n/a
 
      22nd Mar 2007

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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      22nd Mar 2007
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
>
>

 
Reply With Quote
 
 
 
 
Bob
Guest
Posts: n/a
 
      22nd Mar 2007
On Mar 22, 12:21 pm, Peter Bromberg [C# MVP]
<(E-Mail Removed)> wrote:
> 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 programmatically so I can see my Debug.Write results


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      23rd Mar 2007
Programmatically, 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]
> <(E-Mail Removed)> wrote:
> > 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 programmatically so I can see my Debug.Write results
>
>
>

 
Reply With Quote
 
Zytan
Guest
Posts: n/a
 
      23rd Mar 2007
> 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 programmatically. 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

 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      23rd Mar 2007
Zytan,
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/library/0e105c68(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/envdte(VS.80).aspx



-- 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 programmatically. 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
>
>

 
Reply With Quote
 
Laura T.
Guest
Posts: n/a
 
      23rd Mar 2007
Yup. This works. But is it worth of it?

private void ClearOutput()
{
EnvDTE80.DTE2 ide =
(EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.8.0");
ide.ExecuteCommand("Edit.ClearOutputWindow","");
System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);
}

"Peter Bromberg [C# MVP]" <(E-Mail Removed)> ha scritto nel
messaggio news:(E-Mail Removed)...
> Zytan,
> 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/library/0e105c68(VS.80).aspx
> http://msdn2.microsoft.com/en-us/library/envdte(VS.80).aspx
>
>
>
> -- 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 programmatically. 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
>>
>>



 
Reply With Quote
 
Zytan
Guest
Posts: n/a
 
      23rd Mar 2007
> 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/library/0e105c68(VS.80).aspxhttp://msdn2.microsoft.com/en-us/library/envdte(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

 
Reply With Quote
 
Zytan
Guest
Posts: n/a
 
      23rd Mar 2007
> Yup. This works. But is it worth of it?
>
> private void ClearOutput()
> {
> EnvDTE80.DTE2 ide =
> (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("Visu*alStudio.DTE.8.0");
> ide.ExecuteCommand("Edit.ClearOutputWindow","");
> System.Runtime.InteropServices.Marshal.ReleaseComObject(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

 
Reply With Quote
 
Zytan
Guest
Posts: n/a
 
      23rd Mar 2007
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clear history, not "Clear History" or "Clear Forms" or TypedURLS Nick Windows XP Internet Explorer 4 31st Mar 2004 05:22 AM
no tab to clear temporary internet files, clear history Ron Hein Windows XP General 0 9th Sep 2003 08:04 PM
IE Clear History Function -- doesn't clear history Drnick48 Windows XP Internet Explorer 2 29th Aug 2003 03:31 PM
Re: clear history does not clear browser dropdown Maureen Goldman Windows XP Internet Explorer 0 29th Jul 2003 10:23 PM
warning - clear history does not completely clear the history, why? David L Windows XP Internet Explorer 3 3rd Jul 2003 05:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:39 AM.