How to selectively prevent COM Server shutdown

We have an application written in D5 that exposes an IDispatch interface to
allow our report writer to control it.

If the application is already running when the report writer connects to it,
the report writer retrieves its data and disconnects, leaving the
application
running.  No problem.

If the application is not running when the report writer connects to it, the
application starts minimized, the report writer retrieves its data,
disconnects,
and the application shuts down.  Still no problem.

If, however, the application is started by the report writer and then the
user
starts using the application, it shuts down on them as soon as the report
writer is finished with it.

How can I prevent the application from shutting down as soon as the
controller
is finished with it, but only when the application is being "used" by the
user?

Troy Mancinelli
email: troy...@value.net