Heap allocated wasnt deleted.
Here is the code for the PostMessage() in the secondary thread.
static int WINAPI ThreadProc(LPVOID lpContext)
{
...
while(bRunning)
{
...
//Here post message to the main thread
CString * s = new CString("message from secondary thread ");
PostMessage(m_hWnd, WM_ADDSTRING, (WPARAM)s, 0);
}
...
return 0;
}
Message handler for the "WM_ADDSTRING"
LRESULT CMyDialog::OnAddString(WPARAM wp, LPARAM lp )
{
CString * temp=(CString *)wp;
m_ctrlList AddString(*temp);
delete temp;
return 0;
}
I can't work around it, Thanks for any help!

