Partilhar via


IVsTextLines.GetLineText(Int32, Int32, Int32, Int32, String) Method

Definition

Returns the specified span of text in a BSTR.

public:
 int GetLineText(int iStartLine, int iStartIndex, int iEndLine, int iEndIndex, [Runtime::InteropServices::Out] System::String ^ % pbstrBuf);
int GetLineText(int iStartLine, int iStartIndex, int iEndLine, int iEndIndex, [Runtime::InteropServices::Out] std::wstring const & & pbstrBuf);
public int GetLineText (int iStartLine, int iStartIndex, int iEndLine, int iEndIndex, out string pbstrBuf);
abstract member GetLineText : int * int * int * int * string -> int
Public Function GetLineText (iStartLine As Integer, iStartIndex As Integer, iEndLine As Integer, iEndIndex As Integer, ByRef pbstrBuf As String) As Integer

Parameters

iStartLine
Int32

[in] Starting line.

iStartIndex
Int32

[in] Starting character index within the line. This value must be less than or equal to the length of the line.

iEndLine
Int32

[in] Ending line.

iEndIndex
Int32

[in] Ending character index within the line. This value must be less than or equal to the length of the line.

pbstrBuf
String

[out] Text to insert, if any.

Returns

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

Remarks

COM Signature

From textmgr.idl:

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

It is the caller's responsibility to free the BSTR.

Applies to