Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM Server Warning on shutdown

Status
Not open for further replies.

Dachyon

Programmer
Nov 4, 2002
32
NZ
Hi All,
I am developing some software which consists of an application which starts up several other programs using OLE Automation. When you try to shutdown the PC (without closing the application down first), the following message dialog appears :-

COM Server Warning
There are still active COM objects in this application. One or more client have references to these objects, so manually closing this application may cause may cause those client applications to fail.


Does anyone know of a way to avoid this ?

Many Thanks.
Dachyon
 
When I close the application normally, that is exactly what I do. In this case however, the OS decides to close one of the COM servers before the client, so how can the client release the COM servers interface reference when it has'nt been asked to shutdown yet ?

I have tried defining a callback interface in the COM server's type library which allows the server to call a method implemented in each of the clients that have a reference to it. In this method, the client nils the interface reference, allowing the COM server to shutdown nicely without any nasty warnings.
And this works well if I manually shutdown a COM server that was started by a client, however, it does not work when I shut the PC down.....why ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top