Marshal.ReleaseComObject releases a COM object.  It's then up to the
server process to decide whether to terminate or not.

Be aware that ReleaseComObject is *not* the same as IUnknown::Release
(or VB6 Set myRef = Nothing) -- you should *not* call ReleaseComObject
for each managed reference.  Call ReleaseComObject only when you are
completely done with the COM object.  Once you have called
ReleaseComObject, any remaining managed references will probably
invalid.  See the documentation for the gory details.

--
Ivan Towlson
White Carbon


-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Pandha
Permjeet, Slough
Sent: 23 March 2004 17:44
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] COM Interop and freeing references


When the component is used, Windows runs it in a separate process. If
you're
using this in a VB app then you can simply free the reference by doing a
"Set myref = null" and the process automatically disappears.

The problem is how can I achieve the same effect in .Net/C#.

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to