_dispVCProjectEngineEvents.ProjectBuildFinished Method (Object, Int32, Int32, Boolean)

 

This API supports the product 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)

void ProjectBuildFinished(
	object Cfg,
	int warnings,
	int errors,
	bool Cancelled
)

Parameters

Cfg
Type: System.Object

Required. The configuration.

warnings
Type: System.Int32

Required. The warnings.

errors
Type: System.Int32

Required. The errors.

Cancelled
Type: System.Boolean

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

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.

[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
Return to top
Show: