次の方法で共有


IVsGeneratorProgress.GeneratorError Method

Definition

Returns warning and error information to the project system.

public:
 int GeneratorError(int fWarning, System::UInt32 dwLevel, System::String ^ bstrError, System::UInt32 dwLine, System::UInt32 dwColumn);
public:
 int GeneratorError(int fWarning, unsigned int dwLevel, Platform::String ^ bstrError, unsigned int dwLine, unsigned int dwColumn);
int GeneratorError(int fWarning, unsigned int dwLevel, std::wstring const & bstrError, unsigned int dwLine, unsigned int dwColumn);
public int GeneratorError (int fWarning, uint dwLevel, string bstrError, uint dwLine, uint dwColumn);
abstract member GeneratorError : int * uint32 * string * uint32 * uint32 -> int
Public Function GeneratorError (fWarning As Integer, dwLevel As UInteger, bstrError As String, dwLine As UInteger, dwColumn As UInteger) As Integer

Parameters

fWarning
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
UInt32

[in] Severity level of the error. The project system currently ignores the value of this parameter.

bstrError
String

[in] Text of the error to be displayed to the user by means of the Task List.

dwLine
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
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.

Returns

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

Remarks

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.

Applies to