共用方式為


IVsOutputWindowPane.OutputTaskItemString Method

Definition

Adds a string to the Output window and a corresponding item to the task list.

public:
 int OutputTaskItemString(System::String ^ pszOutputString, Microsoft::VisualStudio::Shell::Interop::VSTASKPRIORITY nPriority, Microsoft::VisualStudio::Shell::Interop::VSTASKCATEGORY nCategory, System::String ^ pszSubcategory, int nBitmap, System::String ^ pszFilename, System::UInt32 nLineNum, System::String ^ pszTaskItemText);
public:
 int OutputTaskItemString(Platform::String ^ pszOutputString, Microsoft::VisualStudio::Shell::Interop::VSTASKPRIORITY nPriority, Microsoft::VisualStudio::Shell::Interop::VSTASKCATEGORY nCategory, Platform::String ^ pszSubcategory, int nBitmap, Platform::String ^ pszFilename, unsigned int nLineNum, Platform::String ^ pszTaskItemText);
int OutputTaskItemString(std::wstring const & pszOutputString, Microsoft::VisualStudio::Shell::Interop::VSTASKPRIORITY nPriority, Microsoft::VisualStudio::Shell::Interop::VSTASKCATEGORY nCategory, std::wstring const & pszSubcategory, int nBitmap, std::wstring const & pszFilename, unsigned int nLineNum, std::wstring const & pszTaskItemText);
public int OutputTaskItemString (string pszOutputString, Microsoft.VisualStudio.Shell.Interop.VSTASKPRIORITY nPriority, Microsoft.VisualStudio.Shell.Interop.VSTASKCATEGORY nCategory, string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText);
abstract member OutputTaskItemString : string * Microsoft.VisualStudio.Shell.Interop.VSTASKPRIORITY * Microsoft.VisualStudio.Shell.Interop.VSTASKCATEGORY * string * int * string * uint32 * string -> int
Public Function OutputTaskItemString (pszOutputString As String, nPriority As VSTASKPRIORITY, nCategory As VSTASKCATEGORY, pszSubcategory As String, nBitmap As Integer, pszFilename As String, nLineNum As UInteger, pszTaskItemText As String) As Integer

Parameters

pszOutputString
String

[in] Output string of the task item.

nPriority
VSTASKPRIORITY

[in] Priority of the task item whose values are taken from the VSTASKPRIORITY enumeration.

nCategory
VSTASKCATEGORY

[in] Category of the task item whose values are taken from the VSTASKCATEGORY enumeration.

pszSubcategory
String

[in] Subcategory of the task.

nBitmap
Int32

[in] Bitmap of the task item whose values are taken from the _vstaskbitmap enumeration.

pszFilename
String

[in] Name of the file containing pszOutputString.

nLineNum
UInt32

[in] Line number within pszFilename of pszOutputString.

pszTaskItemText
String

[in] Text of the task item.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsOutputWindowPane::OutputTaskItemString(  
   [in] LPCOLESTR pszOutputString,  
   [in] VSTASKPRIORITY nPriority,  
   [in] VSTASKCATEGORY nCategory,  
   [in] LPCOLESTR pszSubcategory,  
   [in] VSTASKBITMAP nBitmap,  
   [in] LPCOLESTR pszFilename,  
   [in] ULONG nLineNum,  
   [in] LPCOLESTR pszTaskItemText  
);  

The items are not added to the task list until the FlushToTaskList method is called. It is the responsibility of the caller to parse the file name and line number information from the output string and pass these as the pszFilename and nLineNum parameters to this method. In addition, the caller can control the category and subcategory of the task item generated. This task item remains in the task list until the Output window is cleared.

If the output string has the standard format of a compiler error or warning, then the SVsLaunchPadFactory service can be used to easily parse the output string.

Applies to