1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Refresh edit control C++

Discussion in 'Programming' started by Serenoxis, Aug 11, 2010.

  1. Serenoxis

    Serenoxis Active Member

    I've got a Log function that I use throughout a program for various purposes, at the moment it's logging to a text file fine and everything gets written to the buffer I'm using fine. The problem I'm having is that during my main dialog WM_INITDIALOG my log function is called twice and adds the to the buffer as expected. I have a separate dialog window that I can show with an edit control that shows the contents of the buffer and this partially works which is where I'm stuck. I can't get the edit control to refresh when the dialog window is open, to view the updated buffer I have to close the dialog window and reopen. The only way I can think of getting round this problem is by creating a thread that will update the edit control when it's open every 100ms which isn't ideal as it varies when things get logged to several times a second to one every few minutes.

    Searching google hasn't particularly helped as just about everything is MFC/VB and not pure Win32 api as I'm coding and I don't want to convert over the rest of the program.

    Any suggestions?
  2. Serenoxis

    Serenoxis Active Member

    I gave in and used a thread to set the text moved the set dialog text api to my main background thread that took care or some constant updating. Not the best way to do it but it works. Seriously need to keep a note on what's happening when I reuse bits of code I made months ago >.<

Share This Page