Home > Software engineering >  How to update the thread invokes the panel parameters,
How to update the thread invokes the panel parameters,

Time:10-12

In MFC, the establishment of threads, thread invokes the panel parameters, by calling the dialog box handle way call, (DLG - & gt; M_num=0); The beginning of the thread is implemented via a button control, wrote in the button, the updatedata (TRUE), but can't realize data parameters update, please advice, because the thread did not shut down or other reasons?

CodePudding user response:

Unable to realize data update refers to get less than the values in the dialog box in the thread? Try to get the content by means of control handle, such as: GetDlgItem (ID) - & gt; GetWindowText ()

CodePudding user response:

Threads do not directly manipulate the UI object, but the PostMessage sending a message to the main thread, the main thread to update the user interface (UI)

CodePudding user response:

GetDlgItem (ID) - & gt; GetWindowText () this way, the effect is not good, unable to realize update, logically, the update panel parameters under control, access parameters in the thread, should be available parameters has been updated, I have some doubt whether my thread at the end of the last job did not shut down, resulting in parameters cannot be updated,

CodePudding user response:

In this way, was also set tried and did not realize, I and two network transmission in the thread, and this about? Is a halo,,,,,,,

CodePudding user response:

Multiple Threads in the User Interface of http://msdn.microsoft.com/zh-cn/library/ms810439.aspx