_dispVCProjectEngineEvents.ProjectBuildFinished Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Signifies that the building of a project has been completed.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Sub ProjectBuildFinished ( _
    Cfg As Object, _
    warnings As Integer, _
    errors As Integer, _
    Cancelled As Boolean _
)
void ProjectBuildFinished(
    Object Cfg,
    int warnings,
    int errors,
    bool Cancelled
)
void ProjectBuildFinished(
    [InAttribute] Object^ Cfg, 
    [InAttribute] int warnings, 
    [InAttribute] int errors, 
    [InAttribute] bool Cancelled
)
abstract ProjectBuildFinished : 
        Cfg:Object * 
        warnings:int * 
        errors:int * 
        Cancelled:bool -> unit
function ProjectBuildFinished(
    Cfg : Object, 
    warnings : int, 
    errors : int, 
    Cancelled : boolean
)

Parameters

  • Cfg
    Type: Object

    Required. The configuration.

  • warnings
    Type: Int32

    Required. The warnings.

  • errors
    Type: Int32

    Required. The errors.

  • Cancelled
    Type: Boolean

    Required. True if the build was canceled; otherwise false.

Remarks

Builds invoked by an automation program, or by the Visual Studio integrated development environment (IDE), are normally background processes. ProjectBuildFinished is helpful because it causes your program to pause execution until the build that was started by your program is finished.

Examples

[Visual Basic]

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

Public Module Module1
    Sub ProjectBuildFinished(ByVal Cfg As Object, _
 ByVal Warnings As Integer, ByVal errors As Integer, _
 ByVal Canceled As Boolean)
        MsgBox(Warnings)
    End Sub
    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim prj As VCProject
        Dim evt As VCProjectEngineEvents
        Dim cfgs As IVCCollection
        Dim cfg As VCConfiguration
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine
        evt = projEngine.Events
        AddHandler evt.ProjectBuildFinished, AddressOf ProjectBuildFinished
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        cfg.Build()
    End Sub
End Module

.NET Framework Security

See Also

Reference

_dispVCProjectEngineEvents Interface

Microsoft.VisualStudio.VCProjectEngine Namespace