all groups > visual studio .net ide > march 2004 >
You're in the

visual studio .net ide

group:

VS .Net addin - how to write to output window pane from toolwindow


VS .Net addin - how to write to output window pane from toolwindow lars71dk NO[at]SPAM yahoo.com
3/30/2004 6:18:34 AM
visual studio .net ide:
Using the ToolWinAddin project from the vsnet03autosamples, I am
trying to write text to a new pane in the output window. But nothing
comes out. There are no problems using the same code from the connect
class.

I have added the following code to the button click handler, and of
course a using EnvDTE; at the top.

//---
EnvDTE.DTE DTE;
DTE = (EnvDTE.DTE)Microsoft.VisualBasic.Interaction.CreateObject"VisualStudio.DTE.7.1",
"");

Window win = DTE.Windows.Item(EnvDTE.Constants.vsext_wk_OutputWindow);
OutputWindow ow = (OutputWindow)win.Object;
OutputWindowPane owp;

owp = ow.OutputWindowPanes.Add("My Pane");
owp.OutputString("Hello World!");
//---

I am running VS Studio 2003. Any suggestions?

RE: VS .Net addin - how to write to output window pane from toolwindow eddo NO[at]SPAM online.microsoft.com (
3/31/2004 6:00:17 AM
Hi Lars,

You're creating a new instance of the VS .Net IDE with that CreateObject
call. You should use the applicationObject that is a member of your addin's
main class instead.

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties, and confers no rights.
AddThis Social Bookmark Button