Udostępnij za pośrednictwem


_dispVCProjectEngineEvents.ReportError Method

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

Sends an error message to the user interface.

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

Syntax

'Declaration
Sub ReportError ( _
    ErrMsg As String, _
    errCode As Integer, _
    HelpKeyword As String _
)
void ReportError(
    string ErrMsg,
    int errCode,
    string HelpKeyword
)
void ReportError(
    [InAttribute] String^ ErrMsg, 
    [InAttribute] int errCode, 
    [InAttribute] String^ HelpKeyword
)
abstract ReportError : 
        ErrMsg:string * 
        errCode:int * 
        HelpKeyword:string -> unit 
function ReportError(
    ErrMsg : String, 
    errCode : int, 
    HelpKeyword : String
)

Parameters

Remarks

The ReportError method advises the Visual Studio integrated development environment (IDE) that it must handle an error.

Examples

[Visual Basic]

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

Public Module Module1
     Sub ReportError(ByVal ErrMsg As String, ByVal ErrCode As Integer, _
                     ByVal HelpKeyword As String)
        MsgBox(ErrMsg)
    End Sub

    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim evt As VCProjectEngineEvents
        Dim prj As VCProject
        Dim col As IVCCollection
        Dim folder1, folder2 As VCFilter
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine
        evt = projEngine.Events
        AddHandler evt.ReportError, AddressOf ReportError
        col = prj.Filters
        folder1 = col.Item(1)
        folder2 = col.Item(2)
        folder1.Name = folder2.Name
    End Sub
End Module

.NET Framework Security

See Also

Reference

_dispVCProjectEngineEvents Interface

Microsoft.VisualStudio.VCProjectEngine Namespace