chhakuli
asked on
caret index in CRichEditCtrl
How can I get the current character index, i.e., the index of the caret in CRichEditCtrl? There are functions to get current line index, no of lines but I do not find one to get caret index. Any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Excellent observation pagladasu! I wish I'd said that!
-- Dan
-- Dan
One typo. Use:
m_ctlRichEd.GetSel( nStartPos, nEndPos );
m_ctlRichEd.GetSel( nStartPos, nEndPos );
chhakuli,
Why did you accept pagladasus'c comment as the answer? It is very obviously a copy of my comment. It even has the exact same typographical error!
-- Dan
Why did you accept pagladasus'c comment as the answer? It is very obviously a copy of my comment. It even has the exact same typographical error!
-- Dan
U are right, DanRollins. I just made an observation on your comment based on the question. I think u should get the points.
This was the result of a database error, and points may not have properly gone to you . Can you check for us?
We may need to do this question again if you can't see the points.
Moondancer - EE Moderator
We may need to do this question again if you can't see the points.
Moondancer - EE Moderator
long nStartPose, nEndPos;
m_ctlRichEd.void GetSel( nStartPos, nEndPos );
if ( nStartPos == nEndPos } {
MessageBox("There no selection, only a caret");
} else {
MessageBox("some text is selected");
}
-- Dan