Compartir a través de


DoesIncludeExist

 

The latest version of this topic can be found at DoesIncludeExist.

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

Syntax

  
      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

Customizing C++ Wizards with Common JScript Functions
JScript Functions for C++ Wizards
Creating a Custom Wizard
Designing a Wizard