Call
UpdateData
only from the same thread that created the dialog and its controls (the GUI thread), not from any worker threads. If you want to update your dialog regularly, either use a timer (
SetTimer[
^]/
CWnd::SetTimer[
^]) or send/post (
SendMessage[
^]/
PostMessage[
^]) messages towards your dialog from the worker thread. Also, if sending/posting messages, try using the handles of the windows you are trying to send/post messages to rather then handing the pointers to any CWnd-descendants (like CDialog) over to the thread and calling its methods.