Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2007

Tip: Looking for answers? Try searching our database.

C# Finalize not called by CCW - really true?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
czapkofan@gmail.com - 20 Jul 2007 13:46 GMT
Is that really true that in an in-proc C# assembly the Finalize
methods are not called when COM objects are destroyed from the caller?
And if so, is there any solution for this problem? Or the only one is
to define a "Cleanup()" method and tell all users to call it and hope
they will?

I'm using .NET 2.0 and the C# DLL is called from a .vbs file (WSH)
(and it's called with a help of a DLL Surrogate, because I want it to
be available via DCOM)
Sheng Jiang[MVP] - 20 Jul 2007 19:17 GMT
I am calling Marshal.ReleaseComObject every time finished using a com object
from a method call, usually in a finally block to avoid leaking COM objects
when an exception is thrown.

Signature

Sheng Jiang
Microsoft MVP in VC++

> Is that really true that in an in-proc C# assembly the Finalize
> methods are not called when COM objects are destroyed from the caller?
[quoted text clipped - 5 lines]
> (and it's called with a help of a DLL Surrogate, because I want it to
> be available via DCOM)

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.