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.

Set VC++ Directories programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bmelt - 13 Nov 2007 18:06 GMT
I could find only one post regarding VCPlatform:
VCPlatform.ExecutableDirectories should be modifiable while addin is running
http://lab.msdn.microsoft.com/productfeedback/viewbug.aspx?bugid=FDBK39402
Unfortunately, link is broken.

I'd like to open Visual Studio from my program and set VC++ Directories
programmatically. I can set new path using code below, but when I
close-reopen Visual Studio, new path disappears and I can not figure out how
to save it

DTE^ dte =
(DTE^)System::Runtime::InteropServices::Marshal::GetActiveObject("VisualStudio.DTE.8.0");
Projects ^projects = (Projects^)dte->GetObject(L"VCProjects");
VCProjectEngine ^ projectengine = (VCProjectEngine
^)projects->Properties->Item(L"VCProjectEngine")->Object;
IVCCollection ^platforms = (IVCCollection^)projectengine ->Platforms;
VCPlatform ^p64 = (VCPlatform ^)platforms->Item("x64");
if(p64 !=nullptr)
p64->ExecutableDirectories += ";C:\\Temp";
Walter Wang [MSFT] - 14 Nov 2007 06:53 GMT
Hi,

You can try use VCPlatform.CommitChanges method:

#VCPlatform.CommitChanges Method (Microsoft.VisualStudio.VCProjectEngine)
http://msdn2.microsoft.com/en-us/library/microsoft.visualstudio.vcprojecteng
ine.vcplatform.commitchanges(VS.80).aspx

Please note it's marked as internal use and this is not intended to be used
directly from your code.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
bmelt - 14 Nov 2007 16:06 GMT
Hi Walter,
Thank you for fast answer, your suggestion works fine.

Regards,
Boris

> Hi,
>
[quoted text clipped - 17 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
bmelt - 15 Apr 2008 06:36 GMT
Hi Walter,

Now I need to save directories on VS 2003, but there is no CommitChanges
there.
I believe there should be a way to save changes,  at least when we close
Visual Studio?

Regards,
Boris
Kyle Alons - 15 Apr 2008 17:32 GMT
> Hi Walter,
>
> Now I need to save directories on VS 2003, but there is no CommitChanges
> there.
> I believe there should be a way to save changes,  at least when we close
> Visual Studio?

Modify the file %APPDATA%\..\Local Settings\Application
Data\Microsoft\VisualStudio\7.1\VCComponents.dat directly

Signature

---------------------------------------------------
Automate your software builds with Visual Build Pro
http://www.visualbuild.com/

bmelt - 15 Apr 2008 19:52 GMT
Yes, this is a known alternative way to set directories (that does not work
in some scenario).
But the question is how to save changes that were done through DTE on VS
2003 - I do not believe there is a code to make changes and there is no code
to save these changes! On VS 2005 and 2008 we can just call CommitChanges as
Walter explained.

> > Hi Walter,
> >
[quoted text clipped - 5 lines]
> Modify the file %APPDATA%\..\Local Settings\Application
> Data\Microsoft\VisualStudio\7.1\VCComponents.dat directly

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.