CEditView re-sets caret position on save
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have created a program using the doc/view architecture, and using CEditView as the view window. When you are typing something, and then save the document, the caret is moved back to the start of the text, and I want to know how to stop this from happening. I have tried responding to the ON_FILE_SAVE message, and finding the position of the caret with
pCaretPoint = CEditView->GetCaretPos()
, then callingCDocument::OnFileSave()
, and then usingCEditView->SetCaretPos(pCaretPos)
to set the caret position to its initial position, however I think the caret gets re-set after CDocument::OnFileSave() as this has no effect. Any help is much appreciated