NEWPROJ.INF Statements

OverviewsHow Do IDetails

Feature Only in Professional and Enterprise Editions   Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

NEWPROJ.INF contains statements that MFCAPWZ.DLL reads to determine a project structure. A statement in NEWPROJ.INF can use either of the following two forms of syntax:

/directory

This statement directs MFCAPWZ.DLL to create a subdirectory of the Visual C++ project directory. Note that the slash is a forward slash, not a backslash. This is how, for example, AppWizard creates a separate RES subdirectory under the project directory, and how the custom AppWizard project type creates its TEMPLATE subdirectory.

–or–

[flags]template-name tab-character destination-filename

This statement directs MFCAPWZ.DLL to use a custom resource template named template-name to generate a file named by destination-filename. If destination-filename includes a path, all directories on the path must exist. Remember that you can use the /directory statement to create a directory. You generate the tab-character by pressing the TAB key.

flags

A flag is any of three optional characters defined in the table below. They can appear in any order and any combination, but must appear immediately before template-name. No characters (not even whitespace) can separate the flags from each other or from template-name. By default, a file appearing in NEWPROJ.INF is added to the project. If a - flag precedes the file, it is not added.

Template Name Flags

Flag Description
= Copies the template, verbatim, to destination-filename. This flag tells MFCAPWZ.DLL to use CopyTemplate rather than ProcessTemplate. ProcessTemplate is the default.

For example, the following line causes MFCAPWZ.DLL to call CopyTemplate to copy the project’s icon directly to the project:

=ROOT.ICO  $$root$$.ico

Note that using the lowercase version of the $$root$$ macro causes the generated filename to be lowercase. For more information on the root macro, see The Projects Tab on the New Dialog Box Options.

- Specifies that the file should not be added to the project.

!

Specifies that the file should be marked exclude from build.  This forces the build system to ignore the file during a build of the project.
? Specifies that the file should be treated as a Help file.  This puts the file in the “Help Files” folder in the FileView tab of the project workspace window.
: Specifies that the file should be treated as a resource file. This puts the file in the “Resource Files” folder in the FileView tab of the project workspace window.
# Specifies that the file should be treated as a template. This flag implies that the ! flag will be used. This puts the file in the “Template Files” folder in the FileView tab of the project workspace window.
* Forces LoadTemplate to use an MFC AppWizard resource rather than a custom AppWizard resource. Use this flag when you want your custom AppWizard to bypass its own template in preference to the MFC AppWizard’s copy. For example, when the Custom AppWizard project type (CUSTMWZ.AWX) generates a custom AppWizard that is based on an existing sequence of MFC AppWizard steps, it needs the MFC AppWizard’s NEWPROJ.INF, not its own. Using this flag is unnecessary in most situations because MFCAPWZ.DLL looks for a template in the MFC AppWizard’s resources if it can’t first find the template in the custom AppWizard’s resources. This flag simply bypasses the initial check in the custom AppWizard’s resources. For example, the following line causes ProcessTemplate to add the MFCAPWZ.DLL version of DLGROOT.CPP to the generated project’s makefile:
 *+DLGROOT.CPP  $$root$$.cpp

Note that using the lowercase version of the $$root$$ macro causes the generated filename to be lowercase. For more information on the root macro, see Projects Tab on the New Dialog Box Options.

template-name

The resource ID of a custom resource template. When an end user clicks OK in the New Project Information dialog box, MFCAPWZ.DLL begins parsing NEWPROJ.INF. For each template-name found in NEWPROJ.INF, MFCAPPWZ.DLL calls LoadTemplate with template-name to load the custom resource template for processing. If template-name is not found, the custom AppWizard displays an error in a message box, stops code generation, and returns to the dialog box from which template parsing began.

destination-filename

Names the file and directory in which MFCAPWZ.DLL generates the file associated with template-name. The named directory must already exist. If it doesn’t, MFCAPWZ.DLL presents a message box to inform you that it can’t generate the file and stops code generation.

See Also   Overview of Creating a Custom AppWizard, Understanding the Files That AppWizard Creates, Adding Functionality to Your Custom AppWizard, Understanding CONFIRM.INF and NEWPROJ.INF, CONFIRM.INF, NEWPROJ.INF, Understanding Text Templates, How Macros Get Their Values, How to Specify Macros in Directives or Text