共用方式為


IVsTextImage.GetLine(UInt32, Int32, Int32, Int32, LINEDATAEX[]) Method

Definition

Provides direct, line-oriented access to the text buffer.

public:
 int GetLine(System::UInt32 grfGet, int iLine, int iStartIndex, int iEndIndex, cli::array <Microsoft::VisualStudio::TextManager::Interop::LINEDATAEX> ^ pLineData);
int GetLine(unsigned int grfGet, int iLine, int iStartIndex, int iEndIndex, std::Array <Microsoft::VisualStudio::TextManager::Interop::LINEDATAEX> const & pLineData);
public int GetLine (uint grfGet, int iLine, int iStartIndex, int iEndIndex, Microsoft.VisualStudio.TextManager.Interop.LINEDATAEX[] pLineData);
abstract member GetLine : uint32 * int * int * int * Microsoft.VisualStudio.TextManager.Interop.LINEDATAEX[] -> int
Public Function GetLine (grfGet As UInteger, iLine As Integer, iStartIndex As Integer, iEndIndex As Integer, pLineData As LINEDATAEX()) As Integer

Parameters

grfGet
UInt32

[in] Flags providing additional information about the line. For a list of dwFlags values, see GLDE_FLAGS.

iLine
Int32

[in] Integer containing the line number. This is a zero-based value.

iStartIndex
Int32

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

iEndIndex
Int32

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

pLineData
LINEDATAEX[]

[out] Pointer to the filled-in LINEDATA structure. This is allocated by the environment and filled in by the GetLine method.

Returns

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

Remarks

Use the elements of grfGet to specify the level of locking you want to institute. The environment will call ReleaseLine when the line is no longer needed.

COM Signature

From textmgr.idl:

HRESULT IVsTextImage::GetLine(  
   [in] DWORD grfGet,  
   [in] LONG iLine,  
   [in] LONG iStartIndex,  
   [in] LONG iEndIndex,  
   [out, retval] LINEDATAEX * pLineData  
);  

Applies to