Hi,
I am using several threads in my application, each thread can execute a global or a member function(static).
Now I can set the member variable value executing a function include in the App class. But I can't update the View ( UpdateData() is not possible in any function that belongs the thread).
Could you recommend me some way of update the dialog values inside the thread execution?
Thanks.
in the dialog thread add the parts to the cpp file:
Code:
// This should be declared somewhere, add only the ON_MESSAGE part!
BEGIN_MESSAGE_MAP(CFacManDlg, CDialog)
//{{AFX_MSG_MAP(CFacManDlg)
ON_WM_PAINT()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_MY_MESSAGE, OnMyMessage)
END_MESSAGE_MAP()
// implementation of the OnMyMessage method!
LRESULT CMyDlg::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
// do whatever you want and use the wParam and the lParam if needed
return 0; // I handled this message
}
In the header file of the dialog thread add the declaration of the method