IVsGeneratorProgress.GeneratorError Method

Returns warning and error information to the project system.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)


Function GeneratorError ( _
    fWarning As Integer, _
    dwLevel As UInteger, _
    bstrError As String, _
    dwLine As UInteger, _
    dwColumn As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsGeneratorProgress
Dim fWarning As Integer
Dim dwLevel As UInteger
Dim bstrError As String
Dim dwLine As UInteger
Dim dwColumn As UInteger
Dim returnValue As Integer

returnValue = instance.GeneratorError(fWarning, _
    dwLevel, bstrError, dwLine, dwColumn)
int GeneratorError(
    int fWarning,
    uint dwLevel,
    string bstrError,
    uint dwLine,
    uint dwColumn
int GeneratorError(
    [InAttribute] int fWarning, 
    [InAttribute] unsigned int dwLevel, 
    [InAttribute] String^ bstrError, 
    [InAttribute] unsigned int dwLine, 
    [InAttribute] unsigned int dwColumn
abstract GeneratorError : 
        fWarning:int * 
        dwLevel:uint32 * 
        bstrError:string * 
        dwLine:uint32 * 
        dwColumn:uint32 -> int 
function GeneratorError(
    fWarning : int, 
    dwLevel : uint, 
    bstrError : String, 
    dwLine : uint, 
    dwColumn : uint
) : int


  • fWarning
    Type: System.Int32
    [in] Flag that indicates whether this message is a warning or an error. Set to true to indicate a warning or to false to indicate an error.
  • dwLevel
    Type: System.UInt32
    [in] Severity level of the error. The project system currently ignores the value of this parameter.
  • bstrError
    Type: System.String
    [in] Text of the error to be displayed to the user by means of the Task List.
  • dwLine
    Type: System.UInt32
    [in] Zero-based line number that indicates where in the source file the error occurred. This can be –1 (or, 0xFFFFFFFF) if not needed.
  • dwColumn
    Type: System.UInt32
    [in] One-based column number that indicates where in the source file the error occurred. This can be –1 if not needed, but must be –1 if dwLine is –1.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.


COM Signature

From vsshell.idl:

HRESULT IVsGeneratorProgress::GeneratorError(
   [in] BOOL fWarning,
   [in] DWORD dwLevel,
   [in] BSTR bstrError,
   [in] DWORD dwLine,
   [in] DWORD dwColumn

The behavior of the project system with respect to fWarning provides a custom tool with two possibilities for reporting errors:

  • Use IVsGeneratorProgress.GeneratorError to report multiple errors (or, Task List items).

  • Set error information in Generate and rely on the project system to display a task list item automatically.

If a FAILED is returned from the Generate method and at least one error has been added (fWarning = false), the project system does not display its own generic error message. Otherwise, a generic message that is displayed includes the custom tool name and any error information set by the custom tool prior to its return from Generate.

.NET Framework Security

See Also


IVsGeneratorProgress Interface

IVsGeneratorProgress Members

Microsoft.VisualStudio.Shell.Interop Namespace