Board index » delphi » How to gracefully shutdown D3 EXE Auto Server

How to gracefully shutdown D3 EXE Auto Server

I am relatively new to D3 Ole Automation.  I like the benefits of early
binding compared to Delphi 2, but I am having a major problem getting the
server to quit.

I have a Delphi 3 client using early binding that creates a D3 EXE server
object, calls several methods, and then terminates.  The server does not
terminate automatically and, when you close it manually, the automation
warning dialogue box pops up.  I have read that the ref count is
decremented when the dispatch interface variable goes out of scope.  In my
case, it is global.  Is that a problem?

There is an example on the Borland website ( 3240 Exposing a multi string
object in COM) that exhibits the same behavior on termination.  Can anyone
tell me how to make it work properly?

TIA,
Tom Ballew
<tbal...@mindspring.com>

 

Re:How to gracefully shutdown D3 EXE Auto Server


Quote
In article <01bd25bc$566ac880$050106c0@TOM>, Tom Ballew wrote:
> I have read that the ref count is
> decremented when the dispatch interface variable goes out of scope.  In my
> case, it is global.  Is that a problem?

That may be it.  Try clearing the variable before you exit.  Set to NIL if
it's an Interface and NULL if it's a Variant/OLEVariant.

Re:How to gracefully shutdown D3 EXE Auto Server


I tried setting the interface variable to NIL with no effect on the server.
 I checked the reference count and it is stuck at 1, even after the client
terminates.  Is a Quit method necessary on the server?

Thanks for your help,

--
Tom Ballew
<tbal...@mindspring.com>

Other Threads