Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Mon, 08 Oct 2007 13:17:02 -0000,    group: microsoft.public.vstudio.extensibility        back       


Getting the current project?   
I have been working on a custom tool and editor and I have one way to
load the current project so that I can get to the references, but that
is only working with the custom tool. I need to acces the current
project from the custom editor. What I am currently trying is the
following code.

EnvDTE80.DTE2 dte2 = Marshal.GetActiveObject("VisualStudio.DTE.8.0")
as EnvDTE80.DTE2;

I can get the dte2 object loaded but once I have the dte2 object I try
to use the following line of code which does not work. It complains
about the index being out of change. I have also tried 0 in place of
the 1 but that also does not work.

Project project =
dte2.Solution.Projects.Item(1).ProjectItems.ContainingProject;

What can I do to access the current project?
date: Mon, 08 Oct 2007 13:17:02 -0000   author:   offwhite

Re: Getting the current project?   
Just to state the obvious, you have at least 1 project in your
solution right? Try iterating over the Projects collection in a
foreach loop instead and see what you get.
date: Tue, 09 Oct 2007 14:25:01 -0000   author:   Justin Chase

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us