Problems with threads and setting parents
Hi!
I have a threading problem. I have an MDI application with a main window and multiple child windows. My problem is as follows:
I am using 2 child windows, one for calculating stuff and writing the result to a file and another that plots the data from the calculated file. I have the main window running in one thread and the calculation running on another thread. What I want after the calculation is to open a plot window automatically and set its parent to be the main window.
Now I get the error:
"Additional information: Controls created on one thread cannot be parented to a control on a different thread."
The calculation thread is trying to open a child window and to set the parent to be the main window on another thread. I want the main window thread to open the child window. How can I do that from the calculation thread? Can I use events somehow?
-Atle