events and timeouts in VB6
Posted on 2008-06-24
I'm currently adapting a VB6 app, that runs as a DLL without forms.
The functionality involves waiting by a named pipe to a print driver (Black Ice), and currently uses waitforsingleobject to wait for the the pipe to return a result, or else times out.
However, in the latest print driver, this method has changed to using form based events i.e. the app waits for an 'end document' event to fire.
What I need to do is wait for this event to fire, but if it doesn't I need to specify a timeout. Sleep() hangs the process.
-Is it possible to use waitforsingleobject to wait for an VB6 object's event to fire e.g.
waitforsingleobject(driver_endprinting, 30000)... and if so what is the syntax.
-If not, is there another way of doing it? I've had no success using createwaitabletimer