Re: WaitForSingleObject() failing?



You may have to wait for the thread if you want to exit the app (or delete
the objects it uses) before the thread finishes by itself.
It's always a good idea to keep track of the thread(s), to allow graceful
shutdown of those.

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:j39rr152gtuhr11jv36fevc1stdfu0l2fc@xxxxxxxxxx
> ****
> And how does this change the fundamental problem? The fundamental problem
> is that to do
> what you are trying to do, you MUST create the thread suspended, set its
> m_bAutoDelete
> flag to FALSE, and then resume the thread. However, a simpler solution is
> to ignore this
> entirely. You don't need to save the CWinThread object for the first
> thread; just do as I
> suggested, and have the termination of the thread PostMessage a request to
> start the
> second thread. Lose the WaitForSingleObject *entirely*, as it represents
> an untenable
> programming style.
> *****


.



Relevant Pages

  • Re: Return Value from Background System Call
    ... The meaning of a 0 exit status has to be interpreted in the context of the ... launched app. ... Since you're launching this app in the ... status of the shell that launched your background app" at the end of the ...
    (comp.lang.perl.misc)
  • Re: sqlce resources not released on application.exit()?
    ... The correct way to shut down is to exit the Main function. ... Chris Tacke, Embedded MVP ... > the app was using immediately every time. ... >> 3.5 Query Analyzer no longer opens the database for exclusive access. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: VFP8 crash on exit
    ... > exit and crash. ... > and appropriate info, so at next startup app opens all those forms again, ... > issue is, if no form is open when I close the app, app exits gracefully. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Shell launch / Process End
    ... I have a simple VB 6 app that I run two ways. ... do what I need, then Exit. ... command with command line arguments from another app. ... handles are closed then the unload me is called. ...
    (microsoft.public.vb.general.discussion)
  • Re: VFP8 crash on exit
    ... > exit and crash. ... > and appropriate info, so at next startup app opens all those forms again, ... > issue is, if no form is open when I close the app, app exits gracefully. ...
    (microsoft.public.fox.helpwanted)

Loading