Is there a way to ignore callback procedure gracefully?

Posted by jquerijero on 24-Jan-2012 13:09

I need to cancel an asynch appserver call probably because I am closing the window. When I issue a CANCEL-REQUESTS, I really just want to abandon the appserver call even when the request did complete and not cancelled. In this case, I get an error about the callback procedure not being found because the window that contains it is already gone.

All Replies

Posted by Matt Baker on 24-Jan-2012 14:18

Don't attach the callback procedure to the window's owning procedure directly.  Start a persistent procedure, register the windows' owning procedure handle with some variable in the call back procedure and set the callback procedure to call into the window as necessary.  When all the outstanding requests are finished check the window handle.  If its not valid, have the super procedure clean itself up.

You could do the same thing with objects.  Sounds like you need some generic remote procedure call management.

Posted by jquerijero on 24-Jan-2012 15:26

Is there really no way to unhook the callback procedure from the asynch handle or at least suppress the error?

Posted by jquerijero on 20-Mar-2012 16:20

This may not work for when the user is closing the main form without adding a code that waits for the active asynch processes to return.

This thread is closed