Destroying objects on a DCOM server

  • Thread starter Thread starter tilbyj
  • Start date Start date
T

tilbyj

Hello,

I am new to .NET, and am trying to write an application that connects
to a DCOM server that we use. Wonderfully (unlike with ASP) I can now
import the type library for my DCOM server, and have my code checked at
compile time.

However, I have a problem destroying my objects created on the DCOM
server. I create them as follows:

lssServerType = Type.GetTypeFromProgID( "MyServer.SSServer");

lsoSSServer = Activator.CreateInstance(lssServerType);

This works perfectly. (I have also tried using the "new" keyword, which
also works perfectly). To destroy the object (within the same
function), I use:

liRefCount = Marshal.ReleaseComObject (lsoSSServer);

I can see that liRefCount is zero after this call. However, resources
are not released on the DCOM server.

It might help to know that I have old-style ASP code which creates the
same object using CreateObject. When the reference to the object is set
to null in the ASP code, the object is completely destroyed on the DCOM
server.

Thanks for any help you can give!

James
 
Just ignore this please - I have resolved the problem now. It was
nothing to do with .NET but the way I was using the DCOM server.

Thanks

James
 
Back
Top