Visual Studio automation interface 
Author Message
 Visual Studio automation interface

I'm developing add-in for Visual Studio that eventually have to insert some
files to the user project. All I could find are interfaces IGenericProject
and IBuildProject which do not provide such functionality. However I'm sure
this functionality exists because other add-ins like ATL object wizard can
insert files to user project. Please tell how can I solve my problem or
where to find more info about it.

Thanks in advance,
Alex



Thu, 28 Jun 2001 03:00:00 GMT  
 Visual Studio automation interface
AddFile Method
Home Page (Objects) |  Overview |  FAQ |  Reference

Applies to: BuildProject object

Adds a file to the project.

Syntax

object.AddFile file

Parameters

object

An expression that evaluates to a BuildProject object.

file

A String that contains the name of the file.

Example

The following example adds a file to a project:

Sub AddMyFile
If Projects(1).Type = "Build" Then
   Projects(1).AddFile "myfile.cpp"
End If

End Sub


Quote:
>I'm developing add-in for Visual Studio that eventually have to insert some
>files to the user project. All I could find are interfaces IGenericProject
>and IBuildProject which do not provide such functionality. However I'm sure
>this functionality exists because other add-ins like ATL object wizard can
>insert files to user project. Please tell how can I solve my problem or
>where to find more info about it.

>Thanks in advance,
>Alex

Bertrand


Fri, 29 Jun 2001 03:00:00 GMT  
 Visual Studio automation interface
Thank you for reply Bertrand, but unfortunately your script does not run in
Visual Studio 97. It says that such method is not supported. Besides, the
function GetIDsOfNames of IDispatch interface for the project object returns
0x80020006 that means error "Unknown name." Also I couldn't find the
function in the type library for IBuildProject located in devbld.pkg file as
well as in the bldauto.h

After that I decided to look in Visual Studio 98 and have found it there.
Its DISPID is 0x65 but VS97 really doesn't support this DISPID returning
0x80020003 [member not found]. So, unfortunately, the function AddFile is
implemented starting from VS98.

Thanks again for help,
Alex


Quote:
>AddFile Method
>Home Page (Objects) |  Overview |  FAQ |  Reference

>Applies to: BuildProject object

>Adds a file to the project.

>Syntax

>object.AddFile file

>Parameters

>object

>An expression that evaluates to a BuildProject object.

>file

>A String that contains the name of the file.

>Example

>The following example adds a file to a project:

>Sub AddMyFile
>If Projects(1).Type = "Build" Then
>   Projects(1).AddFile "myfile.cpp"
>End If

>End Sub



>>I'm developing add-in for Visual Studio that eventually have to insert
some
>>files to the user project. All I could find are interfaces IGenericProject
>>and IBuildProject which do not provide such functionality. However I'm
sure
>>this functionality exists because other add-ins like ATL object wizard can
>>insert files to user project. Please tell how can I solve my problem or
>>where to find more info about it.

>>Thanks in advance,
>>Alex

>Bertrand



Fri, 29 Jun 2001 03:00:00 GMT  
 Visual Studio automation interface

Quote:

>Thank you for reply Bertrand, but unfortunately your script does not run in
>Visual Studio 97. It says that such method is not supported. Besides, the
>function GetIDsOfNames of IDispatch interface for the project object returns
>0x80020006 that means error "Unknown name." Also I couldn't find the
>function in the type library for IBuildProject located in devbld.pkg file as
>well as in the bldauto.h

>After that I decided to look in Visual Studio 98 and have found it there.
>Its DISPID is 0x65 but VS97 really doesn't support this DISPID returning
>0x80020003 [member not found]. So, unfortunately, the function AddFile is
>implemented starting from VS98.

I have also made some digging on this topic and found that VS97 does not have
any means to add files to the project in its object model. Starting with VS98
it's possible.

Oleg



Sat, 30 Jun 2001 03:00:00 GMT  
 Visual Studio automation interface

says...

Quote:

> >Thank you for reply Bertrand, but unfortunately your script does not run in
> >Visual Studio 97. It says that such method is not supported. Besides, the
> >function GetIDsOfNames of IDispatch interface for the project object returns
> >0x80020006 that means error "Unknown name." Also I couldn't find the
> >function in the type library for IBuildProject located in devbld.pkg file as
> >well as in the bldauto.h

> >After that I decided to look in Visual Studio 98 and have found it there.
> >Its DISPID is 0x65 but VS97 really doesn't support this DISPID returning
> >0x80020003 [member not found]. So, unfortunately, the function AddFile is
> >implemented starting from VS98.

> I have also made some digging on this topic and found that VS97 does not have
> any means to add files to the project in its object model. Starting with VS98
> it's possible.

> Oleg

I have also been searching for information on automatation of project
configuration and found the info on AddFile useful - I had previously
missed this.

Does anyone know if there are also methods to delete files from projects
or obtain a list of all files within a project ?? The object model looks
a bit patchy but maybe I am still just looking in the wrong place in the
help ??

                                                        Roger



Sun, 01 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Visual Studio Automation Interface, part 2

2. Visual Studio desktop layout (Visual Studio/Visual C++ 6)

3. Visual Studio Automation Samples Available

4. Visual Studio Debugger Automation

5. e: *HELP* After install Visual studio .Net, the Visual Studio Enterprise 6.0 stops working

6. *HELP* After install Visual studio .Net, the Visual Studio Enterprise 6.0 stops working

7. Visual Studio 6 back to Visual Studio 5

8. *HELP* After install Visual studio .Net, the Visual Studio Enterprise 6.0 stops working

9. Visual Studio Interface - How to?

10. Visual Studio Interface - How to?

11. Visual Studio Interface - How to?

12. visual studio dde interface

 

 
Powered by phpBB® Forum Software