Hi

I have a problem with AfxGetApp()->PostThreadMessage:
I have a workerthread that wants to post it's result to the WinApp. My problem is that messages are lost when the WinApp shows a MessageBox.
Her is an example:
my WorkerThread does this in a loop:
static i = 0;
// The next line never asserts....:
VERIFY(AfxGetApp()->PostThreadMessage(WM_MYMESSAGEID, (WPARAM) iData, (LPARAM) i))
++i;

And my WinApp has the following messagehandler:
long CVIPApp::OnMyMessage(WPARAM data, LPARAM i)
{
TRACE("i = %d\n", (int) i);
MessageBox(0, "test", "Testing", MB_OK);
// Sleep(3000); // Sleep works fine
return 0
}

If the MessageBox is shown while the workerthread post a message, the message is lost. If however the WinApp sleeps when the message is beeing posted, the message is queued.

My quess is that the MessageBox receives my messages ???

Can anyone help ?