See: http://www.dotnetinterop.com/faq/?q=OfficeCleanup
--- Patrick Steele ([EMAIL PROTECTED]) Lead Software Architect Image Process Design > -----Original Message----- > From: Pandha Permjeet, Slough [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 23, 2004 12:44 PM > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] COM Interop and freeing references > > > Hi, > > I have a .net app that uses a legacy COM Server component > built as a VB6 > ActiveX Exe. > > I have added a reference to it using Visual Studio 2003 > References menus and > can use it perfectly well from my C# app. > > 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#. > The component > is designed to be activated and released many times during > the lifetime of > an application, if the reference cannot be freed then you > will have many of > these processes running. Even if the reference to the > component goes out of > scope or is set to null it does not release the process. I > would think that > it would be released if the reference is garbage collected > but it is not > possible to directly invoke a collection (I've tried > GC.Collect() with no > effect). =================================== 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
