views:

46

answers:

1

I am trying to use ruby win32ole lib and DTE2 Interface to control visual studio 8 \

tried this

require 'win32ole'
ide = WIN32OLE.new('EnvDTE80.DTE2')

and received this error unknown OLE server: EnvDTE80.DTE2

what am I doing wrong, can this work at all ?

+1  A: 

you are using the wrong object name, for visual studio 2008 and opening a solution called MySolution.sln :

require 'win32ole'

objDTE = WIN32OLE.new("VisualStudio.DTE.9.0")
objDTE.MainWindow.Visible = true   #make VS window visible
objDTE.UserControl = true;         #set to false to cause VS to shut down when the script ends 
solution = objDTE.Solution
solution.Open("MySolution.sln");
Alon