I have a thread that periodically uses PostMessage() to update the main dlg with its progress. It works wonderfully until you click on a button or scrollbar on the main dlg and then the main dlg stops receiving (?) the msgs -- or at least the display isn't updated (i.e. an edit box with text messages and a progress ctrl). The thread continues to run to completion, however. Here is a snippet of code that I'm working with:
Any ideas as to how I can have the messages handled even while other actions are being executed on the main dlg?
Thank you in advance for any ideas as to how to correct this problem!
Code:
/*This is where we start processing the source file*/
UINT CLexNexView::LexNexFileProcessorThread(LPVOID pParam)
{
//do some stuff
while(sourceFile.ReadString(line))
{
mainView->PostMessage(WM_MY_STEPIT,0,0);
//do some stuff
}
//do some stuff
}
/////////////////////////////////////////////////////
BOOL CLexNexView::PreTranslateMessage(MSG* pMsg)
{
CLexNexView* view = (CLexNexView*)pMsg->wParam;
CMessageString* msg = (CMessageString*) pMsg->lParam;
int returns = pMsg->wParam;
switch(pMsg->message)
{
case WM_MY_UPDATE_DISPLAY:
Display(*msg,returns);
UpdateData(FALSE);
break;
case WM_MY_STEPIT:
m_Progress.StepIt();
break;
}
return CView::PreTranslateMessage(pMsg);
}
Thank you in advance for any ideas as to how to correct this problem!