Retrieves the line number of the line that contains the specified character index.
A character index is the number of characters from the beginning of the rich edit control. For character counting, an OLE item is counted as a single character.
For more information, see EM_EXLINEFROMCHAR in the Windows SDK.
// The index of the char to get information on. int nIndex = 11; CString strText; m_myRichEditCtrl.GetWindowText(strText); strText = strText.Mid(nIndex, 1); // Dump the index, character and line number. TRACE(_T("nIndex = %d, character = %c, line = %d\r\n"), nIndex, strText, m_myRichEditCtrl.LineFromChar(nIndex));