_dispVCProjectEngineEvents::ReportError Method (String^, Int32, String^)
Visual Studio 2015
This API supports the product infrastructure and is not intended to be used directly from your code.
Sends an error message to the user interface.
Assembly: Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)
Parameters
- ErrMsg
-
Type:
System::String^
Required. The error msg.
- errCode
-
Type:
System::Int32
Required. The error code.
- HelpKeyword
-
Type:
System::String^
Required. The help keyword.
The ReportError method advises the Visual Studio integrated development environment (IDE) that it must handle an error.
[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
Show: