Click here to Skip to main content
15,912,665 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Xml parsing using c++ Pin
Rolf Kristensen29-Nov-08 5:52
Rolf Kristensen29-Nov-08 5:52 
AnswerRe: Xml parsing using c++ Pin
Jijo.Raj29-Nov-08 6:00
Jijo.Raj29-Nov-08 6:00 
AnswerRe: Xml parsing using c++ Pin
Peter Weyzen29-Nov-08 8:36
Peter Weyzen29-Nov-08 8:36 
AnswerRe: Xml parsing using c++ Pin
Hamid_RT30-Nov-08 1:27
Hamid_RT30-Nov-08 1:27 
QuestionDoes the applications those support online updating usually use COM? Pin
followait28-Nov-08 22:55
followait28-Nov-08 22:55 
Questionthread confusions Pin
anilaabc28-Nov-08 22:07
anilaabc28-Nov-08 22:07 
AnswerRe: thread confusions Pin
sashoalm29-Nov-08 0:12
sashoalm29-Nov-08 0:12 
AnswerRe: thread confusions Pin
Code-o-mat29-Nov-08 0:20
Code-o-mat29-Nov-08 0:20 
1. AFAIK no
2. After it terminated -unless it leaks memory or GDI resources- no.
3. I think what you could do is to use 1 or 2 events do control your thread (or threads), so your thread routine would look something like this:

HANDLE Events[] = {TerminateEvent, RepeatEvent};
BOOL   Continue = TRUE;
while (Continue)
{

  //Perform whatever your thread needs to perform at this point here...

  switch (WaitForMultipleObjects(2, Events, FALSE, INFINITE))
  {
  case WAIT_OBJECT_0: //The terminate event has been signalled, so break the loop, do cleanup, exit
    Continue = FALSE;
    break;
  case WAIT_OBJECT_0 + 1: //The repeat event has been signalled, do whatever we need to do again
    continue;
  default: //Unexpected event, do whatever is necesarry here...
    Continue = FALSE;
    break;
  }
}


The TherminateEvent and RepeatEvent you would create using the CreateEvent API call and signal them from another thread. You would probably need to add some more synchronization too. Does this help?

> The problem with computers is that they do what you tell them to do and not what you want them to do. <

AnswerRe: thread confusions Pin
Mark Salsbery29-Nov-08 7:20
Mark Salsbery29-Nov-08 7:20 
GeneralRe: thread confusions Pin
anilaabc30-Nov-08 22:20
anilaabc30-Nov-08 22:20 
GeneralRe: thread confusions Pin
Mark Salsbery1-Dec-08 5:43
Mark Salsbery1-Dec-08 5:43 
GeneralRe: thread confusions Pin
anilaabc1-Dec-08 22:08
anilaabc1-Dec-08 22:08 
QuestionI want to run thread at regular interval in multimedia timer,how should i do?please tell me the better approch Pin
anilaabc28-Nov-08 21:29
anilaabc28-Nov-08 21:29 
AnswerRe: I want to run thread at regular interval in multimedia timer,how should i do?please tell me the better approch Pin
Garth J Lancaster28-Nov-08 23:43
professionalGarth J Lancaster28-Nov-08 23:43 
GeneralRe: I want to run thread at regular interval in multimedia timer,how should i do?please tell me the better approch Pin
anilaabc30-Nov-08 22:15
anilaabc30-Nov-08 22:15 
QuestionHow to use delete for CStringList Pin
Max++28-Nov-08 19:04
Max++28-Nov-08 19:04 
AnswerRe: How to use delete for CStringList Pin
Mark Salsbery28-Nov-08 19:16
Mark Salsbery28-Nov-08 19:16 
QuestionTerminating threads cleanly in a DLL when it is unloaded Pin
Code-o-mat28-Nov-08 11:19
Code-o-mat28-Nov-08 11:19 
AnswerRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Mark Salsbery28-Nov-08 11:57
Mark Salsbery28-Nov-08 11:57 
GeneralRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Code-o-mat28-Nov-08 12:20
Code-o-mat28-Nov-08 12:20 
GeneralRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Randor 28-Nov-08 12:37
professional Randor 28-Nov-08 12:37 
GeneralRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Code-o-mat29-Nov-08 0:23
Code-o-mat29-Nov-08 0:23 
GeneralRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Randor 29-Nov-08 17:24
professional Randor 29-Nov-08 17:24 
AnswerRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Richard Andrew x6428-Nov-08 12:40
professionalRichard Andrew x6428-Nov-08 12:40 
GeneralRe: Terminating threads cleanly in a DLL when it is unloaded Pin
Code-o-mat28-Nov-08 23:39
Code-o-mat28-Nov-08 23:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.