Question
-
If call function and I want that function work not more than 3 sec. how can force to softly exit from it if 3 sec expires. Function not in my code I need somthing similiar to SendMessageTimeOut(...) :)
Alex_Y wrote: Function not in my code I need somthing similiar to SendMessageTimeOut(...) Where's it? In a library? in another process? Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-
If call function and I want that function work not more than 3 sec. how can force to softly exit from it if 3 sec expires. Function not in my code I need somthing similiar to SendMessageTimeOut(...) :)
Start up a secondary thread that will call that function. Then call
WaitForSingleObject()
specifying 3000 for the timeout interval. If the return value isWAIT_TIMEOUT
, then you know that the function is still running.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
-
Alex_Y wrote: Function not in my code I need somthing similiar to SendMessageTimeOut(...) Where's it? In a library? in another process? Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
I actualy subclassing WinProc of ActiveX control. This is bad written control which I don't have source code. Now some times control recieve message from parent and opens socket connection. All my code freeze until ActiveX finish connection. I already make my own UI thread but still parent window calls child windows inluding activex directy via WinProc. So I subclass ActiveX find bad message but I want timmed it. If it not done ReplyMessage(TRUE) and escape. I already tryied CallWinowsProc in sepparete worker thread. Doesn't help. Thats my story. Thanks for reply. :)
-
Start up a secondary thread that will call that function. Then call
WaitForSingleObject()
specifying 3000 for the timeout interval. If the return value isWAIT_TIMEOUT
, then you know that the function is still running.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
I actualy subclassing WinProc of ActiveX control. This is bad written control which I don't have source code. Now some times control recieve message from parent and opens socket connection. All my code freeze until ActiveX finish connection. I already make my own UI thread but still parent window calls child windows inluding activex directy via WinProc. So I subclass ActiveX find bad message but I want timmed it. If it not done ReplyMessage(TRUE) and escape. I already tryied CallWinowsProc in sepparete worker thread. Doesn't help. Thats my story. Thanks for reply. :)