Re: Terminating User-Interface Thread



delvsb wrote:
Thank you very much for the reply.

When PostQuitMessage(0) is used, the application will exit automatically. I only need something that will stop executing the thread while it is still running without exiting the application..
My project is about searching a string in a list. I used thread so that the user can start and stop searching.


Please help me with this....Thank you very much in advance.


The steps I outlined are for terminating a secondary UI thread from the main thread. If your question is how can the secondary UI thread terminate itself, it should call PostQuitMessage(0). This does not cause the application to exit. If you call it from the secondary thread it causes the secondary thread to exit.


--
Scott McPhillips [VC++ MVP]

.



Relevant Pages

  • Re: Program Crashes On Exit
    ... This loop is used for retrieving email - all the emails I have on my POP3 server. ... Everything works fine - unless I exit the program while it is still retrieving the mail. ... You have to signal the secondary thread to exit, then you must NOT let the main thread exit, or destroy anything shared with the thread, until you get a signal back from the secondary thread that it has exited. ...
    (microsoft.public.vc.mfc)
  • Re: WaitForSingleObject blocked whereas a thread has returned
    ... When closing my multithread application, ... wait, in this main thread, for a secondary thread to exit. ... When debugging I can check that this secondary thread is returning ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Terminating Access Applications
    ... frmTest is OPEN and you exit the application by calling any of these three exit ... Executing a routine that closes all open forms prior to calling any of the ... all Form member variables are still available in both Form_Unload ... I also added error handling to catch an issue ...
    (microsoft.public.access.formscoding)
  • Re: return command
    ... > exception. ... > finally in case you "exit" cannot depend on whether there's an exception, ... I tried substituting halt for exit, and it halts without executing the ... consistent thing to do would be to allow the goto, ...
    (borland.public.delphi.non-technical)
  • Re: Exit Value = 35584 from Java.lang.Process
    ... Runtime.exec *does not* invoke a command processor. ... zero-means-success is a common convention but is by no means required. ... the batch file was executing. ... TheNoClassDefError is unrelated to the exit value and just happened to ...
    (comp.lang.java.programmer)