Share via


IParseSink::ErrorMessage Method

Called to specify a message as a result of a parsing error.

HRESULT ErrorMessage ( 
   long startLine,
   long endLine,
   long startIdx,
   long endIdx,
   Severity severity,
   BSTR message
);

Parameters

  • startLine
    [in] Specifies the first line on which the error message occurs.

  • endLine
    [in] Specifies the last line on which the error message occurs.

  • startIdx
    [in] Specifies the starting index of the error message on startLine.

  • endIdx
    [in] Specifies the ending index of the error message on endLine.

  • severity
    [in] Specifies the severity of the error message returned. The severity determines the bitmap used to display the error in the task list window from a choice of hint, warning, or error bitmaps. See Severity Enumeration.

  • message
    [in] Specifies the error message to display in the task list.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

Call this method only if your IBabelService::ParseSource Method implementation is called with a ParseReason Enumeration value of ReasonCheck in the reason parameter. You should call IParseSink::ErrorMessage for each error you find in the span of text passed to you in the text parameter of IBabelService::ParseSource Method.

When using this method, specify the type of error to display in the task list (for example, hint, warning, or error) in the severity parameter and the text of the error message to display in the message parameter. Specify the span of text to underline with an error marker (red wavy underline) in the startLine, endLine, startIdx, and endIdx parameters.

See Also

Reference

IParseSink Interface

IScope Interface

ParseReason Enumeration

Severity Enumeration