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 / August 2004

Tip: Looking for answers? Try searching our database.

Using VSProject interface from unmanaged code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Shaffer - 04 Aug 2004 15:06 GMT
I need to tweak the project settings of a VB.NET project from within my VSIP
project.  Specifically, I need to set the References in a VB.NET project
whose referenced assembly paths are not known until runtime.  I want to do
this from within my unmanaged code but cannot find a header file for the
VSProject interface.  I see that VS.NET ships the VSLangProj.dll assembly
for developing within .NET, but the VSIP SDK doesn't have an equivalent
library for VB/C# projects.  Is there some sort of VB.NET developers SDK
that I need?
"Ed Dore [MSFT]" - 09 Aug 2004 22:42 GMT
Hi Jim,

Regarding setting project properties from your VSIP project. The DTE
automation model can be used to do this. Specifically,
VSLangProj.References.Add. You can access this via the DTE automation
object in your VSIP package. The DTE automation object can be retrieved
using QueryService.

For details on how to retrieve the DTE automation object from an unmanaged
(C++) VSIP package, see one of the first logs in Dr. eX's blog:
  http://blogs.msdn.com/dr._ex/archive/2004/03/09/86972.aspx

From a managed package object, you may utilize the GetService method
implemented on the Package object itself. For example:

    DTE dte = (DTE)GetService(typeof(DTE));

Given a reference to an IServiceProvider interface, such as the one passed
to the IVsWindowPane::SetSite implementation of a ToolWindow object, you
can create a temporary ServiceProvider object and invoke its GetService
method to retrieve the DTE object. For example:

    ServiceProvider sp = new ServiceProvider(vsServiceProvider);
    DTE dte = (DTE)sp.GetService(typeof(DTE));

    (where vsServiceProvider is an IOleServiceProvider member initialized with
the
                IServiceProvider interface passed to the toolwindows
SetSite function)

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with  no warranties, and confers no rights.

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.