You will only need to do four things:
1) At the top of your cpp file (under the #includes) add: #define WM_UPDATEFIELDS WM_APP + 1
2) Go to your Message Map section and add: ON_MESSAGE(WM_UPDATEFIELDS, UpdateDisplay)
3) Add a member function: LRESULT UpdateDisplay(WPARAM wParam, LPARAM lParam)
4) Add the following to the function:
UpdateData((BOOL)wParam);
return 0;
This should now allow you to pass UpdateData TRUE or FALSE from within a thread.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
reference from: codeproject
http://www.codeproject.com/KB/cpp/avoidupdatedata.aspx
posted on 2010-09-28 13:29
胡满超 阅读(521)
评论(0) 编辑 收藏 引用