This documentation is archived and is not being maintained.

VCCodeEvent Object

Visual Studio .NET 2003

An object representing an event code element (declared with the __event keyword).

[Visual Basic .NET]
Public Interface VCCodeEvent
   Inherits IDispatch
[Visual Basic 6]
Class VCCodeEvent
[C++]
interface VCCodeEvent : IDispatch
[C#]
public interface VCCodeEvent : IDispatch
[JScript .NET]
public interface VCCodeEvent extends IDispatch

Remarks

The VCCodeEvent object represents an event code element in a source file, allowing modification or access to information about that specific code element.

Requirements

Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll

Example

This example retrieves all events of the first class and displays their names in a message box.

Sub GetEvents()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    Dim vcEvent as VCCodeEvent
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.Classes.Item(1)
    For Each vcEvent in vcClass.Events
        MsgBox(vcEvent.DisplayName)
    Next
End Sub

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

See Also

VCCodeEvent Object Properties, Methods, and Events | Visual C++ Extensibility Object Model

Show: