Re: CWinThread and Memory Leaks.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: jim_OLP (jimh_at_mcg.net)
Date: 01/14/05


Date: 13 Jan 2005 18:28:08 -0800

Thanks for the reply, I appreciate your expertise and hope you can get
me out of this deadlock.

No inter-thread SendMessage whatsoever. This is all stuff I've done
successfully in the past, at 6.0, and I can't seem to make it work
now.

My main thread creates a CWinThread-derrived class with AfxBeginThread.
That thread creates a modeless dialog in InitInistance. Things are fine
until the main thread enters a loop iinside a message handler (the
reason for the progress thread. The loop has a generous Sleep() in it
so it's not hogging the CPU. After that, the modeless dialog in the
'progress' thread is dead. Spy++ shows it never gets any messages. If I
break into the debugger I see my progress thread blocked at a
DefWndProc call to m_pfnSuper. And it's total fog to me after that
point, as I don't know what m_pfnSuper represents. I suspect MFC is
trying to pass unhandled messages to the main window, thinking it's the
parent of my dialog, but that makes no real sense. When I create the
modeless dialog I don't give it a parent.



Relevant Pages

  • Re: Creating Modeless Dialogs continually causing application to grow
    ... It may be due to storage fragmentation. ... The main application waits for the modeless dialog to finish, ... void CModelessDemoDlg::OnBnClickedButton1 ... the SLIGHTEST CLUE about the class of its parent. ...
    (microsoft.public.vc.mfc)
  • Re: how to pass a value to a modeless dialog?
    ... The problem with passing the pointer of the Parent dialog to the modeless ... The problem of putting your processing code right after you display the ...
    (microsoft.public.vc.mfc)
  • Re: Modeless Dialog
    ... I'm making some modifications in a Dialog based aplication, ... After this I want to create a modeless dialog and load the file saved ... with the list and also work in the main window. ... Popups are always on top of their parent. ...
    (microsoft.public.vc.mfc)
  • Re: Help in creating dialog based application
    ... But the way you would notify the parent dialog to do anything is PostMessage ... dialog as parent but how i will inform the parent window to distroy ... dialog which will create modeless dialogs so when i switch to some ...
    (microsoft.public.vc.mfc)
  • Re: Help in creating dialog based application
    ... you wouldn't want to destroy them; it is more likely you'd want to just hide ... But the way you would notify the parent dialog to do anything is PostMessage ... dialog as parent but how i will inform the parent window to distroy ... dialog which will create modeless dialogs so when i switch to some ...
    (microsoft.public.vc.mfc)