-
Function calls
Hi, say i call a function from within an event. Will the event carry on processing the code below the function call? Or will it wait until the function returns to the caller, and the event will process the rest of the code? If the event does process code after the function not waiting for it to rerurn, is there any way of preventing this?
Thanks for your help.
-
One solution is to send a message to a worker thread that will do the processing. The "event" will continue after sending the message.
SendNotifyMessage()
Kuphryn
-
so does the event still process code even if the function you have called hasn't returned?
-
Correct. SendNotifyMessage() returns immediately. It does not wait.
Kuphryn
-
wait wait wait.....
you didn't mention threads.
if you're saying something like this in the WndProc:
Code:
case WM_PAINT:
HandlePaint(wParam, lParam);
//do something else
break;
the "do something else" line is not executed until HandlePaint() returns. If you meant that handlepaint would be a thread then I apologize for intruding.:)