Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a way to call a function on application exit?
#1
Hi -

I'm having a problem with a hard to reproduce crash - but that's not the reason I'm posting a question. I would like to be able to invoke a function on exit as the application crashes. Here's the issue:

Our application uses CsScript to invoke another application's .NET remoting interface. I use C# for getting the callbacks and I turn these into QM callbacks. This all works fine. But if the application crashes the .NET remoting interface is never disconnected. The other application isn't clever enough to handle this - it keeps timing out when it tries to contact the old instance of my program.

Restarting our app doesn't fix the problem - I get the new callbacks without difficulty but there is a 10-15 second timeout for each one that has to be processed first. The other application's threading model won't process user interactions during the timeout so it really drives them nuts.

If there was a way for me to disconnect from the .NET remoting interface on the way out that would be wonderful.

Thanks.
#2
To call a function in process X when process X crashes - I don't know a way. If the crashing process is a QM macro compiled to exe, it probably cannot handle the exception or whatever is the reason of the crash.


Forum Jump:


Users browsing this thread: 1 Guest(s)