Hi *,
I'd like to access the visual studio object modell from a component. Is
there any way? I want to add and edit files in the same project my
component is.
Best regards,
Torsten
Carlos J. Quintero [VB MVP] - 08 Aug 2006 12:20 GMT
Hi Torsten,
You need to use GetService(GetType(EnvDTE.DTE)) to get an instance of DTE. I
don't know the class which provides the GetService function, though.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
> Hi *,
>
[quoted text clipped - 4 lines]
> Best regards,
> Torsten
Dustin Campbell - 08 Aug 2006 15:38 GMT
> I'd like to access the visual studio object modell from a component.
> Is there any way? I want to add and edit files in the same project my
> component is.
First, you should move the design-time code of this component into a System.ComponentModel.Design.ComponentDesigner
(System.Design.dll) descendent and use a DesignerAttribute on your component
to hook them up if you haven't already. Then, from your designer, you can
use the protected GetService() method to request EnvDTE.DTE.
Best Regards,
Dustin Campbell
Developer Express Inc