DoesIncludeExist

Indicates whether a #include statement for a specified header file exists in a file.

function DoesIncludeExist( 
   oProj, 
   strHeaderFile, 
   strInsertIntoFile  
);

Parameters

  • oProj
    The selected project.

  • strHeaderFile
    The name of the header file to find.

  • strInsertIntoFile
    The source file containing the #include statement for the header file (excluding the path).

Return Value

true if the specified header file is included; otherwise false.

Remarks

Indicates whether a #include for a specific header file exists in the file specified by strInsertIntoFile.

Example

// Check to see if #include for atlbase.h 
// is included in the project's stdafx.h.
// and add it if it is not.
if (!DoesIncludeExist(selProj, "<atlbase.h>", strSTDAFX))
   oCM.AddInclude("<atlbase.h>", strSTDAFX, vsCMAddPositionEnd);

See Also

Tasks

Creating a Custom Wizard

Concepts

Customizing C++ Wizards with Common JScript Functions

Designing a Wizard

Other Resources

JScript Functions for C++ Wizards