Microsoft KB Archive/181503

= PRB: Custom AppWizards Can't Make Per-File Settings/Build Steps =

Article ID: 181503

Article Last Modified on 11/18/2003

-

APPLIES TO

 The AppWizard, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Professional Edition 

-



This article was previously published under Q181503



SYMPTOMS
Custom AppWizards can not make per-file settings or per-file custom build steps on the projects they generate, such as modifying the compiler settings for one .cpp in a project or adding a custom build step to run MIDL on a project's IDL file.



STATUS
This behavior is by design.

NOTE: This problem has been addressed in Visual C++ 6.0 by new methods added to the Configuration object: AddFileSetting, RemoveFileSetting, and AddCustomBuildStepToFile.



MORE INFORMATION
As of Visual C++ 5.0, an automation object model exists that allows COM clients to automate and control the Developer Studio shell. Custom AppWizards now have an extra override in their CCustomAppWiz-derived class, CustomizeProject, which gives the custom AppWizard access to the project settings for the project it is generating. Using IConfiguration interfaces from CustomizeProject's IBuildProject interface, the custom AppWizard can call AddToolSettings, RemoveToolSettings, and AddCustomBuildStep to change various project settings.

Unfortunately, AddToolSettings, RemoveToolSettings, and AddCustomBuildStep operate on the entire project only; they cannot make tool settings or create custom build steps for a single file. The current Developer Studio object model does not support this. Custom build steps for single files must be added by hand after the custom AppWizard generates the projects. Settings made with AddToolSettings and RemoveToolSettings are applied to all files in the project for the specified tool. Custom Build steps added with AddCustomBuildStep run at the end of the build process only and cannot be used to generate dependent files.

For more information about using CustomizeProject to change the settings of a generated project, refer to the Developer Studio documentation on the Developer Studio Object Model. For additional information, please see the following article in the Microsoft Knowledge Base:

173483 HOWTO: Create Custom AppWizards that Generate Non-MFC Projects

<div class="references_section">