I'm working on a program which requires me to update my windows form GUI from another thread(and not the main thread that created this GUI). I tried using:
rMainGUI->textBox3->Text = "TestDLL Try";
rMainGUI->textBox3->Update();
But the program just got stuck at the first line. And if I remove the first line, it gives me an error during runtime, saying:
"Cross-thread operation not valid: Control 'textBox3' accessed from a thread other than the thread it was created on."
I want to know if there is some simple, threadsafe, UI updating function that I can use to update the GUI without messing up those threads? Or, if there is some command I can use to pause the current thread, go to main thread, update GUI and then go back to the current thread?
Here are some screenshots: Scr1 Scr2 Scr3
I have an average knowledge about C++, and a little knowledge about threads. Any help would be much appreciated.