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

Output box.

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • E Offline
    E Offline
    esepich
    wrote on last edited by
    #1

    I am using a common edit control for the purpose of displaying output in text format in my application. Every time I need to write something to the screen I find that I need to put the contents of the edit box into a string put the new output into anothor string, concatenate these two strings togethor and then output this new longer string to the screen. For simplicities sake isn't there a way to just call a function similar to idcoutput->SetWindowText(); that will add text and not overwrite the box with the new text? Thank you, Eric Sepich

    M B 2 Replies Last reply
    0
    • E esepich

      I am using a common edit control for the purpose of displaying output in text format in my application. Every time I need to write something to the screen I find that I need to put the contents of the edit box into a string put the new output into anothor string, concatenate these two strings togethor and then output this new longer string to the screen. For simplicities sake isn't there a way to just call a function similar to idcoutput->SetWindowText(); that will add text and not overwrite the box with the new text? Thank you, Eric Sepich

      M Offline
      M Offline
      Mike Danberg
      wrote on last edited by
      #2

      If you're using CStrings there is a function called 'Append' that lets you add to a string. From the looks of it you aren't using DDX so you're still going to have to call SetWindowText in order to set it, but the append function will allow you to just add to the string. Not sure if this is the case for strings other than CStrings, but I bet any type of string has this functionality. Mike

      1 Reply Last reply
      0
      • E esepich

        I am using a common edit control for the purpose of displaying output in text format in my application. Every time I need to write something to the screen I find that I need to put the contents of the edit box into a string put the new output into anothor string, concatenate these two strings togethor and then output this new longer string to the screen. For simplicities sake isn't there a way to just call a function similar to idcoutput->SetWindowText(); that will add text and not overwrite the box with the new text? Thank you, Eric Sepich

        B Offline
        B Offline
        Blake Coverett
        wrote on last edited by
        #3

        CHARRANGE crEnd = {-1, -1};
        SendMessage(hwnd, EM_EXSETSEL, 0, LPARAM(&crEnd));
        SendMessage(hwnd, EM_REPLACESEL, FALSE, LPARAM(pszText));

        Your class library of choice probably wraps those messages into something prettier, but that's the plain SDK version of what you are looking for. -- -Blake (com/bcdev/blake)

        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