I have a new "output'm trying to run the following code (which I had) address only Visual Studio" Make a pane and give it some lines
public sub WriteToMyNewPane () writes dim victory window = _ dte.Windows.Item (as EnvDTE. Constants.vsWindowKindOutput) as dim Oud Autputvindo as Autputvindo = win Dim owPan as integer = ow.OutputWindowPanes.Count owPane = ow.OutputWindowPanes.Add ( "my new output pane") owPane.Activate () owPane.OutputString ( "My text 1" & amp; vbCrLf) owPane.OutputString ( "My text 2 "& amp; vbCrLf) owPane.OutputString (" My text 3 "& amp; vbCrLf) End Sub
as this is going on, rather than macro, I think it's an independent Console app I want to run in the form of an application that connects with the currently running Visual Studio 2010. I dte is the value may have a hard time figuring out how to set I think I call GetActiveObject, but I'm not sure how. Any signals? Yes, it is possible to some extent, the DTE interface supports out-of-process activation. . Here is the sample code that shows the approach:
Import EnvDTE Module Module1 sub head () Dim DTE DTE = DirectCast (Interaction.CreateObject ("VisualStudio.DTE.10.0"), EnvDTE DTE) as the dte.SuppressUI = false dte.MainWindow.Visible = true as the dim victory window = dte.Windows.Item (Constants.vsWindowKindOutput) dim ow OutputWindow = DirectCast (win.Object, OutputWindow) dim owPane In the OutputWindowPane = ow.OutputWindowPanes.Add ("My New Output Panel") owPane.Activate () owPane.OutputString ("My Text 1" & amp; vbCrLf) owPane.OutputString ("My Text 2" & amp; VbCrLf) owPane.OutputString ("My Text3" & amp; vbCrLf) Console Vitaline ("Enter Enter to End Visual Studio") Console.Redline () End Sub and Module
The previous statement shows why it is not really practical. As soon as your program stops running, the final reference number on the cocalse disappears, from which the visual studio is left.
Comments
Post a Comment