Re: Out of Memory Error: MultiThreading Problem?
Replying to comments I fell are relevant to my original question.
I explained the "reports back" process as matching the message routine
of the other threads... ie using the MessageMgr class' function
SendMsgToDlg which I outlined above. So:
void AppMsgProcessor::ProcessMessage(WPARAM wp, LPARAM lp){
... // Do something to convert lp to CString and process
MessageMgr msg;
msg.SendMsgToDlg(lpConvertedtoCString, LISTCTRL_1);
}
****
And what dialog does it send it to? You are creating a brand-new instance of a
MessageMgr, and I see nothing that associates it with any particular dialog
Again, as was already stated a few times now, it is sent back to the
GUI thread/dialog: MyDlg.
****> CString * s = new CString(strMsg);
pDlg->PostMessage( UWM_ADDSTRING, msgType, LPARAM(s));
****
How is pDlg initialized? Given that this MessageMgr instance was not created until
AppMsgProcessor::ProcessMessage, how does it get a pDlg?
****>}
Sorry, I thought it was a pointer... the correct code is:
HWND hWnd=AfxGetApp()->m_pMainWnd->m_hWnd;
PostMessageA( hWnd, UWM_ADDSTRING, msgType, LPARAM(s));
Are you using multithreading anywhere? Note that freezing up is one of the typical
manifestations of an implicit or explicit SendMessage call that crosses thread boundaries.
joe
Yes, as stated, I am using multithreading. Thanks for your help.