|
-
March 26th, 2012, 01:06 PM
#1
Witing without blocking the code
Hello
I have a function that does a wait on a thread but allows call backs to get in without exiting the thread.
so all i want is a way to avoid thread from exiting but still allowing the callbacks to be processed.
void MsgLoop(){
MSG message;
while (GetMessage(&message,NULL,0,0) && !StopFlag) {
OutputDebugString("MSGLOOP");
TranslateMessage( &message );
DispatchMessage( &message );
}
}
this works perfectly but i dont know how to exit that loop voluntary i tried adding a flag to the while as you can see... but it doesnt ever return from the GetMessageCall.
Sleep doesnt work cause it suspend the thread preventing the call backs to be processed.
any ida to solve this problem?
Thx In Advance!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|