EDN Admin
Well-known member
I have an existing C Windows console program written by a consultant that I have converted to C++ in order to use the try - throw - catch structure to exit from inner calls when an error is encountered.<br/><br/>That part works fine. Now, I need to have a timer running in the background that will throw an exception when it times out, as some inner functions inside DLL code (I have no access to the source!) will hang up occasionally. The code will set the timeout at the start of each function call, and a global catch() will handle the exceptions.<br/><br/>I tried SetTimer() and declared a callback function to throw the exception, but it never gets hit. After some research, I see much about multithreading and mutexes, and would like to do this in the easiest way possible. It would be counter productive in the extreme to try to convert this into a GUI application.<br/><br/>Ive done similar things in embedded processors using C and timer interrupts, and am dismayed that Windows should make such a simple task so difficult. If anyone has done something similar and would be willing to point me at a working code sample, I would be ever so grateful!<br/><br/>The code is running on a Windows XP machine, if it matters.
View the full article
View the full article