Compartilhar via


CRichEditCtrl::GetLine

Retrieves a line of text from this CRichEditCtrl object.

int GetLine(
   int nIndex,
   LPTSTR lpszBuffer 
) const;
int GetLine(
   int nIndex,
   LPTSTR lpszBuffer,
   int nMaxLength 
) const;

Parameters

  • nIndex
    Zero-based index of the line to retrieve.

  • lpszBuffer
    Points to the buffer to receive the text. The first word of the buffer must specify the maximum number of bytes that can be copied into the buffer.

  • nMaxLength
    Maximum number of characters that can be copied into lpszBuffer. The second form of GetLine places this value into the first word of the buffer specified by lpszBuffer.

Return Value

The number of characters copied into lpszBuffer.

Remarks

The copied line does not contain a terminating null character.

Observação

Because the first word of the buffer stores the number of characters to be copied, make sure that your buffer is at least 4 bytes long.

For more information, see EM_GETLINE in the Windows SDK.

Example

See the example for GetLineCount.

Requirements

Header: afxcmn.h

See Also

Reference

CRichEditCtrl Class

Hierarchy Chart

CRichEditCtrl::LineLength

Other Resources

CRichEditCtrl Members