CEditView & Menu Question
-
Hello, Question #1: I'm using a CEditView in my application to display text as it's read from the serial port. I'm having difficulty figuring out how to programatically insert text into the view. I tried the ReplaceSel function which works as long as the cursor remains at the end of the last text that was inserted. If the user selects any text in the window then it will be overwritten by this function. How can I just append a string to the view? Question #2: How can I turn the check marks next to menu options on/off (like the Toolbar & Statusbar commands under the View menu that Appwizard adds by default)? Thanks a lot, Joseph LeBlanc unixd0od@hotmail.com
-
Hello, Question #1: I'm using a CEditView in my application to display text as it's read from the serial port. I'm having difficulty figuring out how to programatically insert text into the view. I tried the ReplaceSel function which works as long as the cursor remains at the end of the last text that was inserted. If the user selects any text in the window then it will be overwritten by this function. How can I just append a string to the view? Question #2: How can I turn the check marks next to menu options on/off (like the Toolbar & Statusbar commands under the View menu that Appwizard adds by default)? Thanks a lot, Joseph LeBlanc unixd0od@hotmail.com
#1: I know I've written some hack code to do this where I got all of the edit's text into a string, appended some more onto that string, and then set the edit's text to be my new string. It was ugly, but it worked :) #2: The check on a menu item comes from CCmdUI::SetCheck(bool), in the UpdateUI handler for that button item. Hope some of that works for ya :-D ***** Jake Palmer www.duke.edu/~jp6
-
Hello, Question #1: I'm using a CEditView in my application to display text as it's read from the serial port. I'm having difficulty figuring out how to programatically insert text into the view. I tried the ReplaceSel function which works as long as the cursor remains at the end of the last text that was inserted. If the user selects any text in the window then it will be overwritten by this function. How can I just append a string to the view? Question #2: How can I turn the check marks next to menu options on/off (like the Toolbar & Statusbar commands under the View menu that Appwizard adds by default)? Thanks a lot, Joseph LeBlanc unixd0od@hotmail.com
Hy! I think we work at the same problem :-D :-D The solution that I find is that I get a HWND handle to the CEditView and then in the thread that read from the serial port call ::SetWindowsText( HWND, LPCTSTR ) ... it's not beautifull programming but it work ( you have to have a variable that hold all your input to this time ) ... but i'm still working at it ;P Bye, Orbital ...the night is long ... but not long enought to do some real coding ...