Board index » delphi » Start a COM Server, then terminate Client

Start a COM Server, then terminate Client

I'm new to this COM stuff, so here's a dumb question for you all...

I want to start a COM server from an application. This server application
will talk to a database and go and do some stuff.

Now, the calling client might terminate.

How do I stop the server from deciding that it no longer has any clients,
and terminating? I want it to hang around and wait for a third application
to do something...

Thanks
Russell

 

Re:Start a COM Server, then terminate Client


Russel,

the reference counting mechanism of COM is by no means a way of keeping the
server up, it's more like to shut it down asap.

I have never done this in Delphi before, but in C++ (ATL) there is a
function called "LockServer" generated by the wizard. I used to return S_OK
without doing anything.

I am pretty sure there is a method you can override in Delphi, to do the
same stuff, but you have to look around. ...

Just checked the online reference of Delphi 4. There is a property called
RefCount which you can increment so it keeps the server up.

Maybe there are other ways too, just found this one in a minute or two.

Hope this helps,

Rudi
Russell.R...@NOSPAM.BigPond.com schrieb in Nachricht
<7ab4l1$61...@forums.borland.com>...

Quote
>I'm new to this COM stuff, so here's a dumb question for you all...

>I want to start a COM server from an application. This server application
>will talk to a database and go and do some stuff.

>Now, the calling client might terminate.

>How do I stop the server from deciding that it no longer has any clients,
>and terminating? I want it to hang around and wait for a third application
>to do something...

>Thanks
>Russell

Other Threads