Export (0) Print
Expand All
Expand Minimize

Events Property

Visual Studio .NET 2003

Returns the object that sources events fired by the project engine. See VCProjectEngineEvents object for more information.

[Visual Basic .NET]
Public ReadOnly Property Events() As Object
[Visual Basic 6]
Property Get Events() As Object
HRESULT __stdcall get_Events(
   /* [out, retval] */ IDispatch** retVal
public object Events {get;}
[JScript .NET]
public function get Events() : Object

Return Value

The object that sourced the events.


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

Public Module Module1
    Sub HookVCEvent()
        Dim projEngine As New VCProjectEngineObject
        Dim prj As VCProject
        Dim evt As VCProjectEngineEvents
        ' if there is a VC Project Load in the solution 
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine()
        evt = projEngine.Events
        AddHandler evt.ProjectBuildStarted, AddressOf VCBuildStartedEvent

    End Sub
    Sub VCBuildStartedEvent(ByVal Cfg As Object)
        MsgBox("VC Build Started")
    End Sub
End Module

See Also

Applies To: VCProjectEngine Object

© 2015 Microsoft