Condividi tramite


Metodo IVsTextLines.GetLineText

Restituisce l'intervallo di testo in un BSTR.

Spazio dei nomi:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Sintassi

'Dichiarazione
Function GetLineText ( _
    iStartLine As Integer, _
    iStartIndex As Integer, _
    iEndLine As Integer, _
    iEndIndex As Integer, _
    <OutAttribute> ByRef pbstrBuf As String _
) As Integer
int GetLineText(
    int iStartLine,
    int iStartIndex,
    int iEndLine,
    int iEndIndex,
    out string pbstrBuf
)
int GetLineText(
    [InAttribute] int iStartLine, 
    [InAttribute] int iStartIndex, 
    [InAttribute] int iEndLine, 
    [InAttribute] int iEndIndex, 
    [OutAttribute] String^% pbstrBuf
)
abstract GetLineText : 
        iStartLine:int * 
        iStartIndex:int * 
        iEndLine:int * 
        iEndIndex:int * 
        pbstrBuf:string byref -> int
function GetLineText(
    iStartLine : int, 
    iStartIndex : int, 
    iEndLine : int, 
    iEndIndex : int, 
    pbstrBuf : String
) : int

Parametri

  • iStartLine
    Tipo: Int32

    [in] Riga di origine.

  • iStartIndex
    Tipo: Int32

    [in] Indice del carattere iniziale all'interno della riga. Questo valore deve essere minore o uguale alla lunghezza della riga.

  • iEndLine
    Tipo: Int32

    [in] Riga finale.

  • iEndIndex
    Tipo: Int32

    [in] Indice del carattere finale della linea. Questo valore deve essere minore o uguale alla lunghezza della riga.

  • pbstrBuf
    Tipo: String%

    [out] Testo da inserire, se presente.

Valore restituito

Tipo: Int32
Se il metodo ha esito positivo, restituisce S_OK.Se non riesce, restituisce un codice di errore.

Note

Firma COM

da textmgr.idl:

HRESULT IVsTextLines::GetLineText(
   [in] long iStartLine,
   [in] CharIndex iStartIndex,
   [in] long iEndLine,
   [in] CharIndex iEndIndex,
   [out] BSTR * pbstrBuf
);

È responsabilità del chiamante liberare la stringa BSTR.

Sicurezza di .NET Framework

Vedere anche

Riferimenti

IVsTextLines Interfaccia

Spazio dei nomi Microsoft.VisualStudio.TextManager.Interop