CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2018
    Posts
    11

    edit box problem

    how do i read the contents of the edit box when the thread is getting executed.i am not able to use the member variable of the edit box which i have created,its popping an error. plz help

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: edit box problem

    1. Why do you think you need to "read the contents of the edit box when the thread is getting executed"? How often do you need to do it?

    2. I already gave you a link to a very useful essay about using worker threads here. Have you read it (the essay)?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2018
    Posts
    11

    Re: edit box problem

    Quote Originally Posted by VictorN View Post
    1. Why do you think you need to "read the contents of the edit box when the thread is getting executed"? How often do you need to do it?

    2. I already gave you a link to a very useful essay about using worker threads here. Have you read it (the essay)?


    i need to read the edit box contents for every button press on the gui..hw do i read the contents without using the edit box member variable.plz help

  4. #4
    Join Date
    Aug 2006
    Posts
    231

    Re: edit box problem

    Windows is a message-oriented operating system, so you don't need a separate thread for doing that. Whenever a button is pressed, a message will be sent that you can handle. Preferably with message maps if you're using MFC.

    https://msdn.microsoft.com/en-us/library/6d1asasd.aspx

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: edit box problem

    Quote Originally Posted by Ramdhyani View Post
    i need to read the edit box contents for every button press on the gui..hw do i read the contents without using the edit box member variable.plz help
    Indeed you can read the content using the edit box member variable. But you have to do it in your main GUI, not from within a worker one!
    Victor Nijegorodov

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: edit box problem

    As said in one of your other threads, do not access the UI from worker threads, only from the main thread.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured