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. RichEdit member variable woes

RichEdit member variable woes

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 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.
  • X Offline
    X Offline
    Xavier Shay
    wrote on last edited by
    #1

    In my project I've got a RichEdit box, with a mapped member variable t_Display. I've created a thread that waits for some input (in this case from a socket) and then tries to add this data to the RichEdit box. I am getting an assert error and I have no idea why. Could anyone help me? The code I'm using is thus: char msg[MAXMSGLEN]; while (fConnected) { sock.Recv(msg, MAXMSGLEN); UpdateData(true); t_Display.Format("%s%s\r\n", (LPCSTR)t_Display, msg); UpdateData(false); } - X 'Reality is the only obstacle to happiness'

    M 1 Reply Last reply
    0
    • X Xavier Shay

      In my project I've got a RichEdit box, with a mapped member variable t_Display. I've created a thread that waits for some input (in this case from a socket) and then tries to add this data to the RichEdit box. I am getting an assert error and I have no idea why. Could anyone help me? The code I'm using is thus: char msg[MAXMSGLEN]; while (fConnected) { sock.Recv(msg, MAXMSGLEN); UpdateData(true); t_Display.Format("%s%s\r\n", (LPCSTR)t_Display, msg); UpdateData(false); } - X 'Reality is the only obstacle to happiness'

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      I assume the UpdateData() call is asserting. You can't pass or access CWnd objects between threads. You'll need to use API-level code to update the edit control from your secondary thread. --Mike-- http://home.inreach.com/mdunn/ While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate. :love: your :bob: with :vegemite: and :beer: Sonork - 100.10414 AcidHelm

      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