--- title: "DoesIncludeExist | Microsoft Docs" ms.custom: "" ms.date: "11/04/2016" ms.reviewer: "" ms.suite: "" ms.technology: - "devlang-cpp" ms.tgt_pltfrm: "" ms.topic: "article" f1_keywords: - "DoesIncludeExist" dev_langs: - "C++" helpviewer_keywords: - "DoesIncludeExist method" ms.assetid: 39751a3d-dfe5-423c-bd94-a53771c3e360 caps.latest.revision: 7 author: "mikeblome" ms.author: "mblome" manager: "ghogen" translation.priority.ht: - "cs-cz" - "de-de" - "es-es" - "fr-fr" - "it-it" - "ja-jp" - "ko-kr" - "pl-pl" - "pt-br" - "ru-ru" - "tr-tr" - "zh-cn" - "zh-tw" --- # 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, "", strSTDAFX)) oCM.AddInclude("", strSTDAFX, vsCMAddPositionEnd); ``` ## See Also [Customizing C++ Wizards with Common JScript Functions](../ide/customizing-cpp-wizards-with-common-jscript-functions.md) [JScript Functions for C++ Wizards](../ide/jscript-functions-for-cpp-wizards.md) [Creating a Custom Wizard](../ide/creating-a-custom-wizard.md) [Designing a Wizard](../ide/designing-a-wizard.md)