CEditView calls OnReplaceSel when the user selects the Replace button in the standard Replace dialog box.

virtual void OnReplaceSel( 
   LPCTSTR lpszFind, 
   BOOL bNext, 
   BOOL bCase, 
   LPCTSTR lpszReplace  


The text to be found.


Specifies the direction of the search. If TRUE, the search direction is toward the end of the buffer. If FALSE, the search direction is toward the beginning of the buffer.


Specifies whether the search is case sensitive. If TRUE, the search is case sensitive. If FALSE, the search is not case sensitive.


The text to replace the found text.

After replacing the selection, this function searches the text in the buffer for the next occurrence of the text specified by lpszFind, in the direction specified by bNext, with case sensitivity specified by bCase. The search is accomplished through a call to FindText. If the text is not found, OnTextNotFound is called.

Override OnReplaceSel to change the way a CEditView-derived object replaces the selected text.

Header: afxext.h

© 2016 Microsoft