Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CEditView & Menu Question

CEditView & Menu Question

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomtutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Joseph LeBlanc
    wrote on last edited by
    #1

    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

    J O 2 Replies Last reply
    0
    • J Joseph LeBlanc

      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

      J Offline
      J Offline
      Jake Palmer
      wrote on last edited by
      #2

      #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

      1 Reply Last reply
      0
      • J Joseph LeBlanc

        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

        O Offline
        O Offline
        Orbital
        wrote on last edited by
        #3

        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 ...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups