Click to See Complete Forum and Search --> : Calling Release() in NT Service Destructor


acrown
May 10th, 1999, 05:36 PM
Does anyone have an insight into the following? VC++ 6.0, NT 4.0 using ATL

1) I'm using DCOM and have an NT service using ATL.
2) The service uses various in process COM dlls
3) When the service is stopped, the destructor calls ->Release on each object.
4) The first call to any ->Release() causes an exception.

If I call release via a method call prior to stopping, all is copaceptic.

Is there a restriction regarding calling release when a service stops? Does ATL call CoUninitialize first?

Thkx

May 11th, 1999, 10:11 AM
John Robbins has shown the implementation of a NT service with a ATL-based COM-object in the Microsoft System Journal 12/97. Perhaps this sample helps you.

http://msdn.microsoft.com/library/periodic/period97/html/bugslayer1212.htm

D.Gollwitzer