I'm creating my VCProject by automation. I added the filters i wanted and the
associated files. Visual Studio puts a Tool by default in the
fileconfiguration depending of the kind of file i add.
For exemple for one file i have the tool "MIDL Tool" and i would change it
for "Custom Build Tool", how can i manage to do this?
You can use the VCFileConfiguration class defined in the
Microsoft.VisualStudio.VCProjectEngine namespace, to set up a custom build
rule similar to how I did it with the macro below. This will probably get
you moving in the right direction.
Sub SetCustomBuild()
Dim pane As OutputWindowPane = GetMiscDumpPane()
Dim prj As VCProject = DTE.Solution.Projects.Item(1).Object
Dim files As IVCCollection = prj.Files
Dim file As VCFile = files.Item("somesourcefile.cpp")
Dim vcConfig As VCConfiguration = prj.Configurations("Debug|Win32")
Dim fileConfig As VCFileConfiguration =
file.FileConfigurations("Debug|Win32")
fileConfig.Tool = vcConfig.Tools("VCCustomBuildTool")
fileConfig.Tool.CommandLine = "mytool.exe $(InputPath)"
fileConfig.Tool.Description = "My custom tool"
fileConfig.Tool.AdditionalDependencies = "None"
fileConfig.Tool.Outputs = "$(OUTPUTDIR)\$(InputName).yes"
End Sub
Sincerely,
Ed Dore [MSFT]
This post is 'AS IS' with no warranties, and confers no rights.
Céline - 18 Feb 2005 09:11 GMT
Thx a lot!
> You can use the VCFileConfiguration class defined in the
> Microsoft.VisualStudio.VCProjectEngine namespace, to set up a custom build
[quoted text clipped - 24 lines]
>
> This post is 'AS IS' with no warranties, and confers no rights.