If I understand you correctly, you are calling SetWindowText() from onDraw(). This is a problem, because SetWindowText() invokes drawing of the control. So your apllication is permanently redrawing its GUI. I would suggest that you store the values in the receiving function in a thread-safe way (look for CRITICAL_SECTION in the documentation). Then create a timer (look for SetTimer()) and in the timer function again in a thread-safe way copy the data to a local variable and display the copy with SetWindowText(). The OnTimer function could look something like this:
void YourDialog::OnTimer(UINT nIDEvent)
{
if (nIDEvent == YourTimerId)
{
EnterCriticalSection(&yourCriticalSection);
CString values = sLiveValues;
LeaveCriticalSection(&yourCriticalSection);
GetDlgItem(IDC_EDITBOX)->SetWindowText(values);
}
}
You can run the timer in any interval convenient for your users.
The good thing about pessimism is, that you are always either right or pleasently surprised.