R
Rich P
The following code sample will clear the output window (Debug window)
programmatically in VS2008 (note: requires a reference to both EnvDTE,
and to EnvDTE80)
private void ClearOutput()
{
EnvDTE80.DTE2 ide =
(EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("V
isualStudio.DTE.9.0");
ide.ExecuteCommand("Edit.ClearOutputWindow","");
System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);
}
If I need to write something to the console (output) window for
debugging/testing from a winform app I can call my ClearOutput() routine
to clear out startup output or previous output. But for the sake of
understanding, I made an additional reference to EnvDTE90 to try
clearing the output window. EnvDTE90 does not have DTE2, instead has
Debugger3.
EnvDTE90.Debugger3 ide =
(EnvDTE90.Debugger3)System.Runtime.InteropServices.Marshal.GetActiveObje
ct("VisualSudio.DTE.9.0");
//error out here -- EnvDTE90.Debugger3 no ExecuteCommand
ide.ExecuteCommand("Edit.ClearOutputWindow","");
Anyone know how to use EnvDTE90 to clear the output window the same as
EnvDTE80 above?
Thanks,
Rich
programmatically in VS2008 (note: requires a reference to both EnvDTE,
and to EnvDTE80)
private void ClearOutput()
{
EnvDTE80.DTE2 ide =
(EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("V
isualStudio.DTE.9.0");
ide.ExecuteCommand("Edit.ClearOutputWindow","");
System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);
}
If I need to write something to the console (output) window for
debugging/testing from a winform app I can call my ClearOutput() routine
to clear out startup output or previous output. But for the sake of
understanding, I made an additional reference to EnvDTE90 to try
clearing the output window. EnvDTE90 does not have DTE2, instead has
Debugger3.
EnvDTE90.Debugger3 ide =
(EnvDTE90.Debugger3)System.Runtime.InteropServices.Marshal.GetActiveObje
ct("VisualSudio.DTE.9.0");
//error out here -- EnvDTE90.Debugger3 no ExecuteCommand
ide.ExecuteCommand("Edit.ClearOutputWindow","");
Anyone know how to use EnvDTE90 to clear the output window the same as
EnvDTE80 above?
Thanks,
Rich