UsePrecompiledHeader Property
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

UsePrecompiledHeader Property

Visual Studio .NET 2003

Enables creation or use of a precompiled header during the build. Exposes the functionality of the compiler's /Yc, /YX, and /Yu options.

[Visual Basic .NET]
Public Property UsePrecompiledHeader() As pchOption
[Visual Basic 6]
Property Get UsePrecompiledHeader() As pchOption
Property Let UsePrecompiledHeader( _
   ByVal NewValue As pchOption _
HRESULT __stdcall get_UsePrecompiledHeader(
   /* [out, retval] */ pchOption* retVal
HRESULT __stdcall put_UsePrecompiledHeader(
   /* [in] */ pchOption NewValue
public pchOption UsePrecompiledHeader {get; set;}
[JScript .NET]
public function get UsePrecompiledHeader() : pchOption
public function set UsePrecompiledHeader(
   NewValue : pchOption


Use the pchOption enumeration to change the value of this property.


The following sample code modifies the UsePrecompiledHeader property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfgs, tools As IVCCollection
        Dim cfg As VCConfiguration
        Dim tool As VCCLCompilerTool
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        tool.UsePrecompiledHeader = pchOption.pchGenerateAuto
    End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCCLCompilerTool Object

© 2016 Microsoft