Condividi tramite


IVsOutputWindowPane.OutputTaskItemString Method

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

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

Syntax

'Dichiarazione
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
'Utilizzo
Dim instance As IVsOutputWindowPane
Dim pszOutputString As String
Dim nPriority As VSTASKPRIORITY
Dim nCategory As VSTASKCATEGORY
Dim pszSubcategory As String
Dim nBitmap As Integer
Dim pszFilename As String
Dim nLineNum As UInteger
Dim pszTaskItemText As String
Dim returnValue As Integer

returnValue = instance.OutputTaskItemString(pszOutputString, _
    nPriority, nCategory, pszSubcategory, _
    nBitmap, pszFilename, nLineNum, pszTaskItemText)
int OutputTaskItemString(
    string pszOutputString,
    VSTASKPRIORITY nPriority,
    VSTASKCATEGORY nCategory,
    string pszSubcategory,
    int nBitmap,
    string pszFilename,
    uint nLineNum,
    string pszTaskItemText
)
int OutputTaskItemString(
    [InAttribute] String^ pszOutputString, 
    [InAttribute] VSTASKPRIORITY nPriority, 
    [InAttribute] VSTASKCATEGORY nCategory, 
    [InAttribute] String^ pszSubcategory, 
    [InAttribute] int nBitmap, 
    [InAttribute] String^ pszFilename, 
    [InAttribute] unsigned int nLineNum, 
    [InAttribute] String^ pszTaskItemText
)
abstract OutputTaskItemString : 
        pszOutputString:string * 
        nPriority:VSTASKPRIORITY * 
        nCategory:VSTASKCATEGORY * 
        pszSubcategory:string * 
        nBitmap:int * 
        pszFilename:string * 
        nLineNum:uint32 * 
        pszTaskItemText:string -> int 
function OutputTaskItemString(
    pszOutputString : String, 
    nPriority : VSTASKPRIORITY, 
    nCategory : VSTASKCATEGORY, 
    pszSubcategory : String, 
    nBitmap : int, 
    pszFilename : String, 
    nLineNum : uint, 
    pszTaskItemText : String
) : int

Parameters

  • pszOutputString
    Type: System.String
    [in] Output string of the task item.
  • pszSubcategory
    Type: System.String
    [in] Subcategory of the task.
  • pszFilename
    Type: System.String
    [in] Name of the file containing pszOutputString.
  • nLineNum
    Type: System.UInt32
    [in] Line number within pszFilename of pszOutputString.
  • pszTaskItemText
    Type: System.String
    [in] Text of the task item.

Return Value

Type: System.Int32
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.

.NET Framework Security

See Also

Reference

IVsOutputWindowPane Interface

IVsOutputWindowPane Members

Microsoft.VisualStudio.Shell.Interop Namespace