Clearing Quick Console

R

Rob Lorimer

I quite often write comments to the 'Quick Console' for debug purposes.

eg Console.WriteLine("My debug text");

I want to clear the quick console whenever my addin starts (while
debugging). I can clear it manually by right-clicking it and choosing 'Clear
All'.

How is this done programmatically?...I've tried Console.Clear() but it
throws an exception!

Rob Lorimer
Extreme Systems Ltd (NZ)
 
P

Peter Huang [MSFT]

Hi

I think you have somewhat confusion about the Console.WriteLine's Console
and the Output Windows' Debug Panel.(I means here for VS.NET 2003, as for
Whidbey issue , it is not officially supported so far)

Actually when we call the Console.WriteLine, it will write in the process's
output stream buffer,(here it is the Excel or Word ... Debugee proecess),
and the Debugger Process(here is the IDE devenv.exe) will capture the
output string and display in the debugger(VS.NET IDE) 's output windows.
Because the excel or word process is not console app, Console.Clear()
throw the exception.

That is to they are in totally different two processes.(devenv.exe,
excel.exe)
Although we can run the macro in the VS.NET IDE to clear the outputwindows,
but it needed to run in the debugger's process.

Dim window As EnvDTE.Window
Dim outputWindow As EnvDTE.OutputWindow
Dim OutputWindowPane As EnvDTE.OutputWindowPane
window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
outputWindow = CType(window.Object, EnvDTE.OutputWindow)
For Each OutputWindowPane In outputWindow.OutputWindowPanes
If OutputWindowPane.Name = "Debug" Then
OutputWindowPane.Clear()
End If
Next

Usually we trace the addin, we can use the Debug.WriteLine and we can
capture the result with other tool, .e.g dbgview.
It will be found in the link below.

The Debug.WriteLine will prefix with a process ID which will tell one from
another.
http://www.sysinternals.com/ntw2k/freeware/debugview.shtml


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top