DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 20 Jul 2007 05:46:15 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    unknown
          2    Sheng Jiang[MVP] uss


C# Finalize not called by CCW - really true?   
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)
Date:Fri, 20 Jul 2007 05:46:15 -0700   Author:  

Re: C# Finalize not called by CCW - really true?   
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.

-- 
Sheng Jiang
Microsoft MVP in VC++
 wrote in message
news:1184935575.408346.310420@k79g2000hse.googlegroups.com...

> 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)
>
Date:Fri, 20 Jul 2007 13:17:25 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us