I have an MFC application which create a thread to receive data from another application.
Now the thread is started and passed the pointer (this) of the main MFC application in order for it to access the methods/properties of the main MFC application that require updating.
This causes an Assertion fault, and it was suggested that PostThreadMessage be used to communicate from the thread to the main application.
My question is - what is the scheme to use for this activity, where the GUI needs to reflect data received, but when the
receive processing is done in a different thread.
How would this be done?
I have tended to pass into the thread the neccessary data/pointer the thread required, but this time I have problems.
If I use a smple timer in place of the thread all is well, but have to run slow to ensure that I do not loose data.
Now the thread is started and passed the pointer (this) of the main MFC application in order for it to access the methods/properties of the main MFC application that require updating.
This causes an Assertion fault, and it was suggested that PostThreadMessage be used to communicate from the thread to the main application.
My question is - what is the scheme to use for this activity, where the GUI needs to reflect data received, but when the
receive processing is done in a different thread.
How would this be done?
I have tended to pass into the thread the neccessary data/pointer the thread required, but this time I have problems.
If I use a smple timer in place of the thread all is well, but have to run slow to ensure that I do not loose data.