How to clear CEditView
Hello
I have a CEditView in a splitterWindow when I hit the return key the data in the windows is captured in the OnChar(...) message handler using GetWindowText(..).
My problem is when I clear the window using SetWindowText("") it leaves a \r\n which is not what I intended. Its making my head bleed, does anyone know how to rid this \r\n.
Thanks
kogg
[390 byte] By [
kogg] at [2007-11-18 22:16:40]

# 1 Re: How to clear CEditView
You trap the Enter key, copy the text, and then clear the view, but the Enter key has allready been processed and will generate a "/r/n" when the OnKeyUp event fires (after clearing the view). Trapping the key in OnChar is too late to cancel the keystroke. You should probably trap the keystroke in PreTranslateMessage rather than in OnChar, and then you should by able to cancel the keystroke so that it does not generate the unwanted "/r/n".
RussG1 at 2007-11-11 1:04:18 >
