Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / April 2008

Tip: Looking for answers? Try searching our database.

Project to VCProject Configuration to VCConfiguration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Herby - 20 Feb 2008 16:49 GMT
I have inherited an AddIn project written in VB.NET and only works on C
++ projects.

Every time an item is selected within the IDE the following event is
captured

Public Shared WithEvents itemSelectionChanged As
EnvDTE.SelectionEvents

Within here they get the active project to them determine if its a
VCProject.

Given an object of Project, what is the best way to convert to
VCProject?

I have used the following code which seems to work but dont fully
understand the semantics of it, i mean why i need to put the call to
Object in  where project is an instance of Project?

vc_project = CType(project.Object, VCProject)

When i try to do the same for VCConfiguration it throws an exception

Dim confg As EnvDTE.Configuration =
project.ConfigurationManager.ActiveConfiguration
Dim cfg As VCConfiguration = CType(confg.Object, VCConfiguration)

Does not work, throws exception ???
Have to use this instead

Dim cfg As VCConfiguration =
CType(prj.Configurations.Item(confg.ConfigurationName),
VCConfiguration)

But when I issue

Dim related As Boolean = confg.GetType().IsInstanceOfType(cfg)
MsgBox(CStr(related))

Get back true!

Can someone please clear up this issue for me?
How do you get the corresponding VC specific objects from the DTE2
general objects?
Herby - 22 Feb 2008 09:52 GMT
Hello anybody out there, with the Knowledge?

Let me greatly simplify the question I have posed above:

I have an event handler for the SelectionEvents.OnChange()

Given the DTE2 object,

       How can I then get the current active VCProject and the
current active VCConfiguration ?
Arnie - 20 Apr 2008 07:14 GMT
If by "active" you mean "selected" since you are handling the
selectionEvents ....

The Solution.SolutionBuild.ActiveProjects  (or something similar to this)
collection is the list of currently selected projects.

-arnie

> Hello anybody out there, with the Knowledge?
>
[quoted text clipped - 6 lines]
>        How can I then get the current active VCProject and the
> current active VCConfiguration ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.